pub struct InterfaceRegistry { /* private fields */ }Expand description
Registry for managing multiple mountable interfaces
Implementations§
Source§impl InterfaceRegistry
impl InterfaceRegistry
Sourcepub fn with_auth(auth_context: Arc<AuthContext>) -> Self
pub fn with_auth(auth_context: Arc<AuthContext>) -> Self
Create a new interface registry with authentication support
Sourcepub fn set_auth_context(&mut self, auth_context: Arc<AuthContext>)
pub fn set_auth_context(&mut self, auth_context: Arc<AuthContext>)
Set the authentication context
Sourcepub fn auth_context(&self) -> Option<&Arc<AuthContext>>
pub fn auth_context(&self) -> Option<&Arc<AuthContext>>
Get the authentication context
Sourcepub fn register(&mut self, interface: MountableInterface) -> Result<()>
pub fn register(&mut self, interface: MountableInterface) -> Result<()>
Register a new interface
Sourcepub fn get(&self, name: &str) -> Option<&MountableInterface>
pub fn get(&self, name: &str) -> Option<&MountableInterface>
Get an interface by name
Sourcepub fn mount(
&self,
interface_name: &str,
prefix: impl AsRef<str>,
) -> Result<Vec<AuthenticatedRoute>>
pub fn mount( &self, interface_name: &str, prefix: impl AsRef<str>, ) -> Result<Vec<AuthenticatedRoute>>
Mount an interface at the given prefix with authentication support
Sourcepub fn mount_all_with_auth(&self) -> Result<Vec<AuthenticatedRoute>>
pub fn mount_all_with_auth(&self) -> Result<Vec<AuthenticatedRoute>>
Mount all interfaces with their default paths and authentication
Sourcepub fn mount_all(&self) -> Result<Vec<AuthenticatedRoute>>
pub fn mount_all(&self) -> Result<Vec<AuthenticatedRoute>>
Mount all interfaces with their default paths
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InterfaceRegistry
impl !RefUnwindSafe for InterfaceRegistry
impl Send for InterfaceRegistry
impl Sync for InterfaceRegistry
impl Unpin for InterfaceRegistry
impl !UnwindSafe for InterfaceRegistry
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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