pub struct SchemaProgram { /* private fields */ }Expand description
A compiled schema, immutable and vocabulary-independent. Cheap to clone (an Arc handle);
safe to share across threads and reuse across as many vocabularies as needed.
Implementations§
Source§impl SchemaProgram
impl SchemaProgram
Sourcepub fn bind(
&self,
vocabulary: &CompiledVocabulary,
) -> Result<BoundSchema, CompileError>
pub fn bind( &self, vocabulary: &CompiledVocabulary, ) -> Result<BoundSchema, CompileError>
Binds this schema to a prepared vocabulary, trie-backed per BindPolicy; self stays reusable.
Sourcepub fn bind_new_vocabulary(
&self,
vocabulary: Arc<Vocabulary>,
) -> Result<BoundSchema, CompileError>
pub fn bind_new_vocabulary( &self, vocabulary: Arc<Vocabulary>, ) -> Result<BoundSchema, CompileError>
Builds and binds a fresh CompiledVocabulary each call; prefer bind with a reused one.
Trait Implementations§
Source§impl Clone for SchemaProgram
impl Clone for SchemaProgram
Source§fn clone(&self) -> SchemaProgram
fn clone(&self) -> SchemaProgram
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SchemaProgram
impl RefUnwindSafe for SchemaProgram
impl Send for SchemaProgram
impl Sync for SchemaProgram
impl Unpin for SchemaProgram
impl UnsafeUnpin for SchemaProgram
impl UnwindSafe for SchemaProgram
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more