pub struct RequestHandlers<C>where
C: RequestHandlerTable,{ /* private fields */ }Implementations§
Source§impl<C> RequestHandlers<C>where
C: RequestHandlerTable,
impl<C> RequestHandlers<C>where
C: RequestHandlerTable,
Sourcepub fn register(
&mut self,
destination: DestinationHash,
path_hash: RequestPathHash,
policy: RequestPolicy,
) -> Result<(), TablePushError>
pub fn register( &mut self, destination: DestinationHash, path_hash: RequestPathHash, policy: RequestPolicy, ) -> Result<(), TablePushError>
Register (or re-register) a handler: last write wins, and a policy change starts from an empty allow list, the same upsert posture destination registration takes.
Sourcepub fn unregister(
&mut self,
destination: &DestinationHash,
path_hash: &RequestPathHash,
) -> bool
pub fn unregister( &mut self, destination: &DestinationHash, path_hash: &RequestPathHash, ) -> bool
Remove a handler row if it exists. An already absent route is an idempotent no-op, which lets runtime reconcilers converge safely.
pub fn allow( &mut self, destination: &DestinationHash, path_hash: &RequestPathHash, identity: IdentityHash, ) -> Result<(), RequestHandlerError>
pub fn disallow( &mut self, destination: &DestinationHash, path_hash: &RequestPathHash, identity: &IdentityHash, ) -> Result<(), RequestHandlerError>
Sourcepub fn permits(
&self,
destination: &DestinationHash,
path_hash: &RequestPathHash,
remote_identity: Option<&IdentityHash>,
) -> bool
pub fn permits( &self, destination: &DestinationHash, path_hash: &RequestPathHash, remote_identity: Option<&IdentityHash>, ) -> bool
RNS 1.4.2 Link.handle_request’s gate, exactly: no handler refuses, AllowNone refuses, AllowAll permits, AllowList permits only a link whose peer has identified as a listed identity.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl<C> Debug for RequestHandlers<C>where
C: Debug + RequestHandlerTable,
impl<C> Debug for RequestHandlers<C>where
C: Debug + RequestHandlerTable,
Source§impl<C> Default for RequestHandlers<C>where
C: Default + RequestHandlerTable,
impl<C> Default for RequestHandlers<C>where
C: Default + RequestHandlerTable,
Source§fn default() -> RequestHandlers<C>
fn default() -> RequestHandlers<C>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<C> Freeze for RequestHandlers<C>where
C: Freeze,
impl<C> RefUnwindSafe for RequestHandlers<C>where
C: RefUnwindSafe,
impl<C> Send for RequestHandlers<C>where
C: Send,
impl<C> Sync for RequestHandlers<C>where
C: Sync,
impl<C> Unpin for RequestHandlers<C>where
C: Unpin,
impl<C> UnsafeUnpin for RequestHandlers<C>where
C: UnsafeUnpin,
impl<C> UnwindSafe for RequestHandlers<C>where
C: UnwindSafe,
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