pub struct ProtoCache { /* private fields */ }Implementations§
Source§impl ProtoCache
impl ProtoCache
pub fn new() -> Self
Sourcepub fn with_max_entries(max_entries: usize) -> Self
pub fn with_max_entries(max_entries: usize) -> Self
Create a cache with a custom maximum number of entries.
When the cache reaches capacity, the oldest entry is evicted (FIFO).
pub fn get_or_compile<P, I>( &self, proto_path: P, includes: I, ) -> Result<DescriptorPool, ProtoCompileError>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ProtoCache
impl RefUnwindSafe for ProtoCache
impl Send for ProtoCache
impl Sync for ProtoCache
impl Unpin for ProtoCache
impl UnsafeUnpin for ProtoCache
impl UnwindSafe for ProtoCache
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