CliProtocol

Struct CliProtocol 

Source
pub struct CliProtocol { /* private fields */ }

Implementations§

Source§

impl CliProtocol

Source

pub fn pass(&self) -> &Vec<String>

Source

pub fn args(&self) -> &HashMap<String, String>

Source

pub fn args_mut(&mut self) -> &mut HashMap<String, String>

Source

pub async fn route( self, router: Arc<Router<Self>>, context_data: HashMap<String, Box<dyn Any + Send>>, )

Source

pub fn new(base: usize) -> Self

Methods from Deref<Target = Meta<Vec<String>, String>>§

Source

pub fn req(&self) -> Result<&Req, DceErr>

Source

pub fn req_mut(&mut self) -> &mut Option<Req>

Source

pub fn resp_mut(&mut self) -> &mut Option<Response<Resp>>

Source

pub fn heads(&self) -> &HashMap<String, String>

Source

pub fn resp_heads(&self) -> &HashMap<String, String>

Source

pub fn resp_heads_mut(&mut self) -> &mut HashMap<String, String>

Trait Implementations§

Source§

impl Debug for CliProtocol

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Deref for CliProtocol

Source§

type Target = Meta<Vec<String>, String>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for CliProtocol

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl From<Vec<String>> for CliProtocol

Source§

fn from(value: Vec<String>) -> Self

Converts to this type from the input type.
Source§

impl Into<String> for CliProtocol

Source§

fn into(self) -> String

Converts this type into the (usually inferred) input type.
Source§

impl RoutableProtocol for CliProtocol

Source§

type Req = Vec<String>

Source§

type Resp = String

Source§

fn body<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = DceResult<Serialized>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn pack_resp(&self, serialized: Serialized) -> Self::Resp

Source§

fn handle_result( self, result: DceResult<()>, context: &mut Context<Self>, ) -> Option<Self::Resp>

Source§

fn path(&self) -> &str

Source§

fn id(&self) -> Option<&str>

Source§

fn handle<'async_trait>( self, router: Arc<Router<Self>>, context_data: HashMap<String, Box<dyn Any + Send>>, ) -> Pin<Box<dyn Future<Output = Option<Self::Resp>> + Send + 'async_trait>>
where Self: Send + 'async_trait,

Source§

fn api_match( &self, apis: &[&'static (dyn ApiTrait<Self> + Sync + Send)], ) -> Result<&'static (dyn ApiTrait<Self> + Sync + Send), DceErr>

Source§

fn deserializer<'a, ReqDto>( deserializers: &'a [Box<dyn Deserializer<ReqDto> + Sync + Send>], _context: &Context<Self>, ) -> Result<&'a Box<dyn Deserializer<ReqDto> + Sync + Send>, DceErr>

Source§

fn serializer<'a, RespDto>( serializers: &'a [Box<dyn Serializer<RespDto> + Sync + Send>], _context: &Context<Self>, ) -> Result<&'a Box<dyn Serializer<RespDto> + Sync + Send>, DceErr>

Source§

fn deserialize<ReqDto>( serializers: &[Box<dyn Deserializer<ReqDto> + Sync + Send>], seq: Serialized, context: &Context<Self>, ) -> Result<ReqDto, DceErr>

Source§

fn serialize<RespDto>( serializers: &[Box<dyn Serializer<RespDto> + Sync + Send>], dto: Serializable<RespDto>, context: &Context<Self>, ) -> Result<Serialized, DceErr>

Source§

fn pack_responsible<RespDto>( context: &Context<Self>, serializers: &[Box<dyn Serializer<RespDto> + Sync + Send>], responsible: Serializable<RespDto>, ) -> Result<Option<Response<Self::Resp>>, DceErr>
where RespDto: 'static,

Source§

fn parse_api_method_and_extras( prop_tuples: Vec<(&'static str, Box<dyn Any + Sync + Send>)>, ) -> (Option<Box<dyn Method<Self> + Sync + Send>>, HashMap<&'static str, Box<dyn Any + Sync + Send>>)

Source§

fn parse_api_method( _prop_mapping: &mut HashMap<&'static str, Box<dyn Any + Sync + Send>>, ) -> Option<Box<dyn Method<Self> + Sync + Send>>

Source§

fn try_print_err(response: &Result<(), DceErr>)

Source§

fn err_into(self, err: DceErr) -> Self::Resp

Auto Trait Implementations§

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.