pub struct SchemaCache { /* private fields */ }Expand description
Cache for generated schemas.
Implementations§
Source§impl SchemaCache
impl SchemaCache
Sourcepub fn get(&self, name: &str) -> Option<&GeneratedSchema>
pub fn get(&self, name: &str) -> Option<&GeneratedSchema>
Get a cached schema by name.
Sourcepub fn store(&mut self, schema: GeneratedSchema)
pub fn store(&mut self, schema: GeneratedSchema)
Store a schema.
Sourcepub fn record_usage(&mut self, name: &str)
pub fn record_usage(&mut self, name: &str)
Record usage of a schema.
Sourcepub fn usage_count(&self, name: &str) -> usize
pub fn usage_count(&self, name: &str) -> usize
Get usage count for a schema.
Sourcepub fn schema_names(&self) -> Vec<&str>
pub fn schema_names(&self) -> Vec<&str>
Get all schema names.
Sourcepub fn remove(&mut self, name: &str) -> Option<GeneratedSchema>
pub fn remove(&mut self, name: &str) -> Option<GeneratedSchema>
Remove a schema.
Trait Implementations§
Source§impl Clone for SchemaCache
impl Clone for SchemaCache
Source§fn clone(&self) -> SchemaCache
fn clone(&self) -> SchemaCache
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SchemaCache
impl Debug for SchemaCache
Source§impl Default for SchemaCache
impl Default for SchemaCache
Source§fn default() -> SchemaCache
fn default() -> SchemaCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SchemaCache
impl RefUnwindSafe for SchemaCache
impl Send for SchemaCache
impl Sync for SchemaCache
impl Unpin for SchemaCache
impl UnwindSafe for SchemaCache
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