pub trait Publish: Session {
type PublishPayload<'a>
where Self: 'a;
// Required method
fn publish<'a>(
&mut self,
payload: Self::PublishPayload<'a>
) -> Result<PublishOutcome<Self::PublishPayload<'a>>, Error>;
}
Expand description
A Session
implementation that can publish payloads.
Required Associated Types§
sourcetype PublishPayload<'a>
where
Self: 'a
type PublishPayload<'a> where Self: 'a
The type given to the publish(..)
function.
Required Methods§
sourcefn publish<'a>(
&mut self,
payload: Self::PublishPayload<'a>
) -> Result<PublishOutcome<Self::PublishPayload<'a>>, Error>
fn publish<'a>( &mut self, payload: Self::PublishPayload<'a> ) -> Result<PublishOutcome<Self::PublishPayload<'a>>, Error>
Write the given payload
to the session.
This will return PublishOutcome::Incomplete
if the publish is not immediately completed fully,
in which case T
of Incomplete(T)
data must be retried.
Note that it is possible for some implementations that a publish is partially complete, so you must
re-attempt the data encapsulated by Incomplete
, not the data originally passed into the function.
This guidance can only be ignored when you are not writing generic code and you know that your
Publish
impl is “all-or-none”.
Object Safety§
This trait is not object safe.