Skip to main content

ProtocolIndex

Struct ProtocolIndex 

Source
pub struct ProtocolIndex {
    pub component_index: HashMap<String, u32>,
    pub route_cache: CompiledRouteCache,
    /* private fields */
}
Expand description

Pre-computed index for a protocol, caching expensive lookups.

Both the component bit-index map and the compiled route template cache are deterministic for a given protocol. Building them once avoids redundant work on every request.

Fields§

§component_index: HashMap<String, u32>

Component name → bit index for inventory tracking.

§route_cache: CompiledRouteCache

Compiled route template patterns (lazily populated on first match).

Implementations§

Source§

impl ProtocolIndex

Source

pub fn new(protocol: &WebUIProtocol) -> Self

Build a protocol index from a compiled protocol.

Auto Trait Implementations§

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.