Skip to main content

RequestHandlerTable

Trait RequestHandlerTable 

Source
pub trait RequestHandlerTable {
Show 13 methods // Required methods fn capacity(&self) -> usize; fn len(&self) -> usize; fn destinations(&self) -> &[DestinationHash]; fn path_hashes(&self) -> &[RequestPathHash]; fn policies(&self) -> &[RequestPolicy]; fn push( &mut self, destination: DestinationHash, path_hash: RequestPathHash, policy: RequestPolicy, ) -> Result<(), TablePushError>; fn remove_at(&mut self, slot: usize); fn set_policy_at(&mut self, slot: usize, policy: RequestPolicy); fn clear_allowed_at(&mut self, slot: usize); fn allowed_contains_at(&self, slot: usize, identity: &IdentityHash) -> bool; fn allow_at( &mut self, slot: usize, identity: IdentityHash, ) -> Result<(), TablePushError>; fn disallow_at(&mut self, slot: usize, identity: &IdentityHash); // Provided method fn is_empty(&self) -> bool { ... }
}

Required Methods§

Source

fn capacity(&self) -> usize

Source

fn len(&self) -> usize

Source

fn destinations(&self) -> &[DestinationHash]

Source

fn path_hashes(&self) -> &[RequestPathHash]

Source

fn policies(&self) -> &[RequestPolicy]

Source

fn push( &mut self, destination: DestinationHash, path_hash: RequestPathHash, policy: RequestPolicy, ) -> Result<(), TablePushError>

Insert a fresh handler row with an empty allow list. The wrapper owns upsert semantics and never pushes a duplicate key.

Source

fn remove_at(&mut self, slot: usize)

Source

fn set_policy_at(&mut self, slot: usize, policy: RequestPolicy)

Source

fn clear_allowed_at(&mut self, slot: usize)

Source

fn allowed_contains_at(&self, slot: usize, identity: &IdentityHash) -> bool

Source

fn allow_at( &mut self, slot: usize, identity: IdentityHash, ) -> Result<(), TablePushError>

Source

fn disallow_at(&mut self, slot: usize, identity: &IdentityHash)

Provided Methods§

Source

fn is_empty(&self) -> bool

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl RequestHandlerTable for HeapRequestHandlerTable

Source§

impl<const MAX_REQUEST_HANDLERS: usize> RequestHandlerTable for FixedRequestHandlerTable<MAX_REQUEST_HANDLERS>