Skip to main content

Metadata

Struct Metadata 

Source
pub struct Metadata<'a> { /* private fields */ }
Expand description

Caller-provided, fixed-capacity Metadata slots.

Implementations§

Source§

impl<'a> Metadata<'a>

Source

pub fn new(slots: &'a mut [Option<(&'a str, &'a str)>]) -> Self

Source

pub fn set_source(&mut self, source: Arc<dyn MetadataSource>)

Retain an existing shared source of Metadata without allocating per Query.

Source

pub fn set_enabled(&mut self, enabled: bool)

Enable public Plugin Metadata for the current Server Block.

Source

pub fn enabled(&self) -> bool

Source

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.

Source

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.

Source

pub fn insert_inline(&mut self, name: &'static str, value: &str) -> bool

Copy a short value whose lifetime is shorter than the Query’s.

Source

pub fn insert_copied(&mut self, name: &'static str, value: &str) -> bool

Copy a value from a temporary Plugin buffer without allocating.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.