ConnectionToPlugin

Trait ConnectionToPlugin 

Source
pub trait ConnectionToPlugin:
    Sized
    + Send
    + Unpin
    + ToPluginizableConnection<Self>
    + 'static {
    // Required methods
    fn get_connection<'a>(
        &self,
        field: ConnectionField,
        w: &'a mut [u8],
    ) -> Result<&'a mut [u8]>;
    fn set_connection(
        &mut self,
        field: ConnectionField,
        value: &[u8],
    ) -> Result<(), CTPError>;
    fn get_recovery<'a>(
        &self,
        field: RecoveryField,
        w: &'a mut [u8],
    ) -> Result<&'a mut [u8]>;
    fn set_recovery(
        &mut self,
        field: RecoveryField,
        value: &[u8],
    ) -> Result<(), CTPError>;
}
Expand description

A trait that needs to be implemented by the host implementation to provide plugins information from the host.

Required Methods§

Source

fn get_connection<'a>( &self, field: ConnectionField, w: &'a mut [u8], ) -> Result<&'a mut [u8]>

Gets the related ConnectionField and writes it as a serialized value in w. It is up to the plugin to correctly handle the value and perform the serialization.

Source

fn set_connection( &mut self, field: ConnectionField, value: &[u8], ) -> Result<(), CTPError>

Sets the related ConnectionField to the provided value, that was serialized with content value. It is this function responsibility to correctly convert the input to the right type.

Source

fn get_recovery<'a>( &self, field: RecoveryField, w: &'a mut [u8], ) -> Result<&'a mut [u8]>

Gets the related RecoveryField and writes it as a serialized value in w. It is up to the plugin to correctly handle the value and perform the serialization.

Source

fn set_recovery( &mut self, field: RecoveryField, value: &[u8], ) -> Result<(), CTPError>

Sets the related RecoveryField to the provided value, that was serialized with content value. It is this function responsibility to correctly convert the input to the right type.

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§