Struct dce_router::api::Api

source ·
pub struct Api<Raw, ReqDto, Req, Resp, RespDto>
where Raw: RawRequest + Debug + 'static, ReqDto: 'static, Req: From<ReqDto> + 'static, Resp: Into<RespDto> + 'static, RespDto: 'static,
{ /* private fields */ }

Implementations§

source§

impl<Raw, ReqDto, Req, Resp, RespDto> Api<Raw, ReqDto, Req, Resp, RespDto>
where Raw: RawRequest + Debug + 'static, ReqDto: 'static, Req: From<ReqDto> + 'static, Resp: Into<RespDto> + 'static, RespDto: 'static,

source

pub fn new( controller: Controller<Request<Raw, ReqDto, Req, Resp, RespDto>, Raw::Resp>, deserializers: Vec<Box<dyn Deserializer<ReqDto> + Send + Sync>>, serializers: Vec<Box<dyn Serializer<RespDto> + Send + Sync>>, method: Option<Box<dyn Method<Raw::Rpi> + 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<Request<Raw, ReqDto, Req, Resp, RespDto>, Raw::Resp>

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<Raw, ReqDto, Req, Resp, RespDto> ApiTrait<Raw> for Api<Raw, ReqDto, Req, Resp, RespDto>
where Raw: RawRequest + Debug + Send + 'static, ReqDto: 'static, Req: From<ReqDto> + Debug + Send + Sync + 'static, Resp: Into<RespDto> + Send + Sync + 'static, RespDto: 'static,

source§

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

source§

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

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, raw: &Raw) -> bool

source§

fn call_controller<'async_trait>( &'static self, context: RequestContext<Raw> ) -> Pin<Box<dyn Future<Output = DceResult<Option<Raw::Resp>>> + Send + 'async_trait>>
where Self: 'async_trait,

source§

impl<Raw, ReqDto, Req, Resp, RespDto> Debug for Api<Raw, ReqDto, Req, Resp, RespDto>
where Raw: RawRequest + Debug + 'static + Debug, ReqDto: 'static + Debug, Req: From<ReqDto> + 'static + Debug, Resp: Into<RespDto> + 'static + Debug, RespDto: 'static + Debug, Raw::Resp: Debug, Raw::Rpi: Debug,

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<Raw, ReqDto, Req, Resp, RespDto> !RefUnwindSafe for Api<Raw, ReqDto, Req, Resp, RespDto>

§

impl<Raw, ReqDto, Req, Resp, RespDto> Send for Api<Raw, ReqDto, Req, Resp, RespDto>
where Req: Send, Resp: Send,

§

impl<Raw, ReqDto, Req, Resp, RespDto> Sync for Api<Raw, ReqDto, Req, Resp, RespDto>
where Req: Sync, Resp: Sync,

§

impl<Raw, ReqDto, Req, Resp, RespDto> Unpin for Api<Raw, ReqDto, Req, Resp, RespDto>
where Req: Unpin, Resp: Unpin,

§

impl<Raw, ReqDto, Req, Resp, RespDto> !UnwindSafe for Api<Raw, ReqDto, Req, Resp, 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>,

§

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>,

§

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.