pub struct DescriptorTable {
descriptors: Vec<&'static FieldDescriptor>,
index: FastMap<&'static str, FastMap<&'static str, DescriptorId>>,
}Expand description
Indexed collection of all FieldDescriptors registered via inventory.
Fields§
§descriptors: Vec<&'static FieldDescriptor>§index: FastMap<&'static str, FastMap<&'static str, DescriptorId>>Implementations§
Source§impl DescriptorTable
impl DescriptorTable
Sourcepub fn build() -> Self
pub fn build() -> Self
Collect all registered descriptors and build the lookup table.
§Panics
Panics if more than u16::MAX descriptors are registered.
Sourcepub fn iter(&self) -> DescriptorIter<'_> ⓘ
pub fn iter(&self) -> DescriptorIter<'_> ⓘ
Iterate all descriptors with their IDs.
pub(crate) fn lookup( &self, domain: &str, name: &str, ) -> Option<(DescriptorId, &FieldDescriptor)>
pub(crate) fn get(&self, id: DescriptorId) -> Option<&FieldDescriptor>
Trait Implementations§
Source§impl Debug for DescriptorTable
impl Debug for DescriptorTable
Source§impl<'a> IntoIterator for &'a DescriptorTable
impl<'a> IntoIterator for &'a DescriptorTable
Source§type Item = (DescriptorId, &'a FieldDescriptor)
type Item = (DescriptorId, &'a FieldDescriptor)
The type of the elements being iterated over.
Source§type IntoIter = DescriptorIter<'a>
type IntoIter = DescriptorIter<'a>
Which kind of iterator are we turning this into?
Auto Trait Implementations§
impl Freeze for DescriptorTable
impl RefUnwindSafe for DescriptorTable
impl Send for DescriptorTable
impl Sync for DescriptorTable
impl Unpin for DescriptorTable
impl UnsafeUnpin for DescriptorTable
impl UnwindSafe for DescriptorTable
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more