Struct Router

Source
pub struct Router<Rp: RoutableProtocol + 'static> { /* private fields */ }

Implementations§

Source§

impl<Rp: RoutableProtocol + Debug + 'static> Router<Rp>

Source

pub fn new() -> DceResult<Self>

Source

pub fn set_separator( self, path_part_separator: char, suffix_separator: char, ) -> Self

Source

pub fn suffix_boundary(&self) -> char

Source

pub fn apis_tree(&self) -> &Arc<ATree<ApiBranch<Rp>, &'static str>>

Source

pub fn before_controller(&self) -> &Option<EventHandler<Rp>>

Source

pub fn after_controller(&self) -> &Option<EventHandler<Rp>>

Source

pub fn set_event_handlers( self, before_controller: Option<EventHandler<Rp>>, after_controller: Option<EventHandler<Rp>>, ) -> Self

Source

pub fn push( self, supplier: fn() -> &'static (dyn ApiTrait<Rp> + Send + Sync), ) -> Self

Source

pub fn consumer_push(self, consumer: fn(Self) -> Self) -> Self

Source

pub fn ready(self) -> DceResult<&'static Arc<Router<Rp>>>

Source

pub async fn route(context: &mut Context<Rp>) -> DceResult<()>

Source

pub async fn id_route(context: &mut Context<Rp>) -> DceResult<()>

Trait Implementations§

Source§

impl<Rp: Debug + RoutableProtocol + 'static> Debug for Router<Rp>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<Rp> Freeze for Router<Rp>

§

impl<Rp> !RefUnwindSafe for Router<Rp>

§

impl<Rp> Send for Router<Rp>

§

impl<Rp> Sync for Router<Rp>

§

impl<Rp> Unpin for Router<Rp>

§

impl<Rp> !UnwindSafe for Router<Rp>

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.