Trait websocat::specifier::SpecifierClass
source · pub trait SpecifierClass: Debug {
// Required methods
fn get_name(&self) -> &'static str;
fn get_prefixes(&self) -> Vec<&'static str>;
fn help(&self) -> &'static str;
fn construct(&self, arg: &str) -> Result<Rc<dyn Specifier>, Box<dyn Error>>;
fn construct_overlay(
&self,
inner: Rc<dyn Specifier>
) -> Result<Rc<dyn Specifier>, Box<dyn Error>>;
fn is_overlay(&self) -> bool;
fn message_boundary_status(&self) -> ClassMessageBoundaryStatus;
fn multiconnect_status(&self) -> ClassMulticonnectStatus;
fn alias_info(&self) -> Option<&'static str>;
}
Expand description
A trait for a each specified type’s accompanying object
Don’t forget to register each instance at the list_of_all_specifier_classes
macro.
Required Methods§
sourcefn get_prefixes(&self) -> Vec<&'static str>
fn get_prefixes(&self) -> Vec<&'static str>
Names to match command line parameters against, with a :
colon if needed
sourcefn construct(&self, arg: &str) -> Result<Rc<dyn Specifier>, Box<dyn Error>>
fn construct(&self, arg: &str) -> Result<Rc<dyn Specifier>, Box<dyn Error>>
Given the command line text, construct the specifier
arg is what comes after the colon (e.g. //echo.websocket.org
in ws://echo.websocket.org
)
sourcefn construct_overlay(
&self,
inner: Rc<dyn Specifier>
) -> Result<Rc<dyn Specifier>, Box<dyn Error>>
fn construct_overlay( &self, inner: Rc<dyn Specifier> ) -> Result<Rc<dyn Specifier>, Box<dyn Error>>
Given the inner specifier, construct this specifier.
sourcefn is_overlay(&self) -> bool
fn is_overlay(&self) -> bool
Returns if this specifier is an overlay
sourcefn message_boundary_status(&self) -> ClassMessageBoundaryStatus
fn message_boundary_status(&self) -> ClassMessageBoundaryStatus
True if it is not expected to preserve message boundaries on reads
fn multiconnect_status(&self) -> ClassMulticonnectStatus
sourcefn alias_info(&self) -> Option<&'static str>
fn alias_info(&self) -> Option<&'static str>
If it is Some then is_overlay, construct and most other things are ignored and prefix get replaced…