pub struct Metadata<'a> { /* private fields */ }Expand description
Caller-provided, fixed-capacity Metadata slots.
Implementations§
Source§impl<'a> Metadata<'a>
impl<'a> Metadata<'a>
pub fn new(slots: &'a mut [Option<(&'a str, &'a str)>]) -> Self
Sourcepub fn set_source(&mut self, source: Arc<dyn MetadataSource>)
pub fn set_source(&mut self, source: Arc<dyn MetadataSource>)
Retain an existing shared source of Metadata without allocating per Query.
Sourcepub fn set_enabled(&mut self, enabled: bool)
pub fn set_enabled(&mut self, enabled: bool)
Enable public Plugin Metadata for the current Server Block.
pub fn enabled(&self) -> bool
Sourcepub fn with_self_lookup(
slots: &'a mut [Option<(&'a str, &'a str)>],
handle: Option<&'a SelfLookupHandle>,
) -> Self
pub fn with_self_lookup( slots: &'a mut [Option<(&'a str, &'a str)>], handle: Option<&'a SelfLookupHandle>, ) -> Self
Construct fresh Metadata while retaining detached Self Lookup routing.
Sourcepub fn insert(&mut self, name: &'a str, value: &'a str) -> bool
pub fn insert(&mut self, name: &'a str, value: &'a str) -> bool
Insert or replace a named value; returns false when no slot is free.
Sourcepub fn insert_inline(&mut self, name: &'static str, value: &str) -> bool
pub fn insert_inline(&mut self, name: &'static str, value: &str) -> bool
Copy a short value whose lifetime is shorter than the Query’s.
Sourcepub fn insert_copied(&mut self, name: &'static str, value: &str) -> bool
pub fn insert_copied(&mut self, name: &'static str, value: &str) -> bool
Copy a value from a temporary Plugin buffer without allocating.
pub fn get(&self, name: &str) -> Option<&str>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Metadata<'a>
impl<'a> !UnwindSafe for Metadata<'a>
impl<'a> Forget for Metadata<'a>
impl<'a> Freeze for Metadata<'a>
impl<'a> Move for Metadata<'a>
impl<'a> Send for Metadata<'a>
impl<'a> Sync for Metadata<'a>
impl<'a> Unpin for Metadata<'a>
impl<'a> UnsafeUnpin for Metadata<'a>
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