Skip to main content

CliProtocol

Struct CliProtocol 

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

Implementations§

Source§

impl CliProtocol

Source

pub fn script_path(&self) -> &str

Source

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

Source

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

Source

pub fn args(&self, key: &str) -> Vec<&str>

Source

pub fn bool(&self, key: &str) -> bool

Source

pub fn arg(&self, key: &str) -> Option<&str>

Source

pub fn arg_or<'a>(&'a self, key: &str, def: &'a str) -> &'a str

Source

pub fn new() -> Self

Source

pub fn sync_handle(self, routed: DceResult<RouteMatch<'_, CliProtocol>>)

Source

pub async fn handle(self, routed: DceResult<RouteMatch<'_, CliProtocol>>)

Methods from Deref<Target = RpMeta<()>>§

Source

pub fn raw(&self) -> &Req

Source

pub fn raw_mut(&mut self) -> &mut Req

Source

pub fn clear_buffer(&mut self) -> Vec<u8> ⓘ

Source

pub fn is_resp_empty(&self) -> bool

Source

pub fn write(&mut self, bytes: Bytes)

Source

pub fn write_string(&mut self, str: String)

Source

pub fn set_ctx_data(&mut self, key: String, value: Box<dyn Any + Send>)

Source

pub fn ctx_data(&self, key: &str) -> Option<&Box<dyn Any + Send>>

Source

pub fn ctx_data_remove(&mut self, key: &str) -> Option<Box<dyn Any + Send>>

Source

pub fn sid(&self) -> Option<&str>

Source

pub fn set_session(&mut self)

Source

pub fn session(&self)

Source

pub fn set_resp_sid(&mut self, sid: String)

Source

pub fn resp_sid(&self) -> Option<&str>

Trait Implementations§

Source§

impl Deref for CliProtocol

Source§

type Target = RpMeta<()>

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 RoutableProtocol for CliProtocol

Source§

type Req = ()

Source§

fn path(&self) -> &str

Source§

fn sync_body(&mut self) -> DceResult<Bytes>

Source§

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

Source§

fn id(&self) -> isize

Source§

fn sync_body_string(&mut self) -> Result<String, DceError>

Source§

fn body_string<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<String, DceError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Source§

fn match_api( &self, apis: &Vec<&'static Api<Self>>, ) -> Option<&'static Api<Self>>

Source§

fn try_print_err(&self, err: &Option<DceError>)

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.