Struct Api

Source
pub struct Api<Rp, ReqDto, RespDto>
where Rp: RoutableProtocol + Send + Sync + Debug + 'static, ReqDto: 'static, RespDto: 'static,
{ /* private fields */ }

Implementations§

Source§

impl<Rp, ReqDto, RespDto> Api<Rp, ReqDto, RespDto>
where Rp: RoutableProtocol + Debug + Send + Sync + 'static, ReqDto: 'static, RespDto: 'static,

Source

pub fn new( controller: Controller<Rp, ReqDto, RespDto>, deserializers: Vec<Box<dyn Deserializer<ReqDto> + Send + Sync>>, serializers: Vec<Box<dyn Serializer<RespDto> + Send + Sync>>, method: Option<Box<dyn Method<Rp> + Send + Sync>>, path: &'static str, id: &'static str, omission: bool, redirect: &'static str, name: &'static str, unresponsive: bool, extras: HashMap<&'static str, Box<dyn Any + Send + Sync>>, ) -> Self

Source

pub fn controller(&self) -> &Controller<Rp, ReqDto, RespDto>

Source

pub fn deserializers(&self) -> &Vec<Box<dyn Deserializer<ReqDto> + Send + Sync>>

Source

pub fn serializers(&self) -> &Vec<Box<dyn Serializer<RespDto> + Send + Sync>>

Trait Implementations§

Source§

impl<Rp, ReqDto, RespDto> ApiTrait<Rp> for Api<Rp, ReqDto, RespDto>
where Rp: RoutableProtocol + Send + Sync + Debug + 'static, ReqDto: 'static, RespDto: 'static,

Source§

fn method(&self) -> &Option<Box<dyn Method<Rp> + Send + Sync>>

Source§

fn path(&self) -> &'static str

Source§

fn suffixes(&self) -> &BTreeSet<Suffix>

Source§

fn id(&self) -> &'static str

Source§

fn omission(&self) -> bool

Source§

fn redirect(&self) -> &'static str

Source§

fn name(&self) -> &'static str

Source§

fn unresponsive(&self) -> bool

Source§

fn extras(&self) -> &HashMap<&'static str, Box<dyn Any + Send + Sync>>

Source§

fn method_match(&self, rp: &Rp) -> bool

Source§

fn call_controller<'a, 'async_trait>( &'static self, context: &'a mut Context<Rp>, ) -> Pin<Box<dyn Future<Output = DceResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait,

Source§

impl<Rp, ReqDto, RespDto> Debug for Api<Rp, ReqDto, RespDto>
where Rp: RoutableProtocol + Send + Sync + Debug + 'static + Debug, ReqDto: 'static + Debug, RespDto: 'static + Debug,

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<Rp, ReqDto, RespDto> Freeze for Api<Rp, ReqDto, RespDto>

§

impl<Rp, ReqDto, RespDto> !RefUnwindSafe for Api<Rp, ReqDto, RespDto>

§

impl<Rp, ReqDto, RespDto> Send for Api<Rp, ReqDto, RespDto>

§

impl<Rp, ReqDto, RespDto> Sync for Api<Rp, ReqDto, RespDto>

§

impl<Rp, ReqDto, RespDto> Unpin for Api<Rp, ReqDto, RespDto>

§

impl<Rp, ReqDto, RespDto> !UnwindSafe for Api<Rp, ReqDto, RespDto>

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.