Trait puffin::put::Put

source ·
pub trait Put<PB: ProtocolBehavior>: Stream<PB> + 'static {
    // Required methods
    fn progress(&mut self) -> Result<(), Error>;
    fn reset(&mut self, new_name: AgentName) -> Result<(), Error>;
    fn descriptor(
        &self,
    ) -> &AgentDescriptor<<<PB as ProtocolBehavior>::ProtocolTypes as ProtocolTypes>::PUTConfig>;
    fn describe_state(&self) -> String;
    fn is_state_successful(&self) -> bool;
    fn shutdown(&mut self) -> String;
    fn version() -> String
       where Self: Sized;
}
Expand description

Generic trait used to define the interface with a concrete library implementing the protocol.

Required Methods§

source

fn progress(&mut self) -> Result<(), Error>

Process incoming buffer, internal progress, can fill in the output buffer

source

fn reset(&mut self, new_name: AgentName) -> Result<(), Error>

In-place reset of the state

source

fn descriptor( &self, ) -> &AgentDescriptor<<<PB as ProtocolBehavior>::ProtocolTypes as ProtocolTypes>::PUTConfig>

source

fn describe_state(&self) -> String

Returns a textual representation of the state in which self is

source

fn is_state_successful(&self) -> bool

Checks whether the Put is in a good state

source

fn shutdown(&mut self) -> String

Shut down the PUT by consuming it and returning a string that summarizes the execution.

source

fn version() -> String
where Self: Sized,

Returns a textual representation of the version of the PUT used by self

Implementors§