Skip to main content

schema_is_held

Function schema_is_held 

Source
pub fn schema_is_held(collection: &str) -> bool
Expand description

Whether this server holds a lexicon that defines collection’s record.

The question the optimistic stance turns on, and the one a write response’s validationStatus reports: valid when this is true and the record passed, unknown when it is false and the record was stored unchecked.

use didbot_schema::schema_is_held;
assert!(schema_is_held("bot.did.registration"));
// A lexicon defined elsewhere, whether or not this server writes it.
assert!(!schema_is_held("com.example.thing"));
assert!(!schema_is_held("app.bsky.feed.post"));