Trait PluggableTransportPrivate

Source
pub trait PluggableTransportPrivate {
    // Required methods
    fn inner(&mut self) -> Result<&mut AsyncPtChild, PtError>;
    fn set_inner(&mut self, newval: Option<AsyncPtChild>);
    fn identifier(&self) -> &str;
    fn specific_params_contains(&self, transport: &PtTransportName) -> bool;

    // Provided methods
    fn common_transport_launched_handler(
        &self,
        protocol: Option<String>,
        transport: PtTransportName,
        endpoint: SocketAddr,
        methods: &mut HashMap<PtTransportName, PtClientMethod>,
    ) -> Result<(), PtError> { ... }
    fn get_child_from_pt_launch(
        inner: &Option<AsyncPtChild>,
        transports: &Vec<PtTransportName>,
        binary_path: &PathBuf,
        arguments: &[String],
        all_env_vars: HashMap<OsString, OsString>,
    ) -> Result<AsyncPtChild, PtError> { ... }
    fn try_match_common_messages<'life0, 'life1, 'life2, 'async_trait, R>(
        &'life0 self,
        rt: &'life1 R,
        deadline: Instant,
        async_child: &'life2 mut AsyncPtChild,
    ) -> Pin<Box<dyn Future<Output = Result<Option<PtMessage>, PtError>> + Send + 'async_trait>>
       where R: 'async_trait + Runtime,
             Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
}
Available on crate feature managed-pts only.
Expand description

Defines some helper methods that are required later on

Required Methods§

Source

fn inner(&mut self) -> Result<&mut AsyncPtChild, PtError>

Return the AsyncPtChild if it exists

Source

fn set_inner(&mut self, newval: Option<AsyncPtChild>)

Set the AsyncPtChild

Source

fn identifier(&self) -> &str

Return a loggable identifier for this transport.

Source

fn specific_params_contains(&self, transport: &PtTransportName) -> bool

Checks whether a transport is specified in our specific parameters

Provided Methods§

Source

fn common_transport_launched_handler( &self, protocol: Option<String>, transport: PtTransportName, endpoint: SocketAddr, methods: &mut HashMap<PtTransportName, PtClientMethod>, ) -> Result<(), PtError>

Common handler for ClientTransportLaunched and ServerTransportLaunched

Source

fn get_child_from_pt_launch( inner: &Option<AsyncPtChild>, transports: &Vec<PtTransportName>, binary_path: &PathBuf, arguments: &[String], all_env_vars: HashMap<OsString, OsString>, ) -> Result<AsyncPtChild, PtError>

Attempt to launch the PT and return the corresponding [AsyncPtChild]

Source

fn try_match_common_messages<'life0, 'life1, 'life2, 'async_trait, R>( &'life0 self, rt: &'life1 R, deadline: Instant, async_child: &'life2 mut AsyncPtChild, ) -> Pin<Box<dyn Future<Output = Result<Option<PtMessage>, PtError>> + Send + 'async_trait>>
where R: 'async_trait + Runtime, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Consolidates some of the PtMessage potential matches to deduplicate code

Note that getting a PtMessage from this method implies that the method was unable to match it and thus you should continue handling the message. Getting None after error handling means that a match was found and the appropriate action was successfully taken, and you don’t need to worry about it.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§