Enum ockam::stream::StreamWorkerCmd
source · [−]pub enum StreamWorkerCmd {
Fetch,
Pull {
num: usize,
},
}
Expand description
A protocol exchanged between a stream consumer and stream producer
Variants
Fetch
Trigger a fetch event
These events are fired from worker to itself to create a delayed reactive response
Pull
Fields
num: usize
Number of messages to pull.
Zero is used as a sentinal to indicate “all messages”.
Pull messages from the consumer’s buffer
Implementations
sourceimpl StreamWorkerCmd
impl StreamWorkerCmd
sourcepub fn fetch() -> ProtocolPayload
pub fn fetch() -> ProtocolPayload
Return a ProtocolPayload
containing a
Fetch
event.
sourcepub fn pull(num: usize) -> ProtocolPayload
pub fn pull(num: usize) -> ProtocolPayload
Pull messages from the consumer’s buffer
When sending Pull { num: 0 }
all available messages are
pulled. It is recommended to configure your stream consumer
into “forwarding mode”.
Trait Implementations
sourceimpl Debug for StreamWorkerCmd
impl Debug for StreamWorkerCmd
sourceimpl<'de> Deserialize<'de> for StreamWorkerCmd
impl<'de> Deserialize<'de> for StreamWorkerCmd
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl ProtocolParser for StreamWorkerCmd
impl ProtocolParser for StreamWorkerCmd
sourceimpl Serialize for StreamWorkerCmd
impl Serialize for StreamWorkerCmd
impl Message for StreamWorkerCmd
Auto Trait Implementations
impl RefUnwindSafe for StreamWorkerCmd
impl Send for StreamWorkerCmd
impl Sync for StreamWorkerCmd
impl Unpin for StreamWorkerCmd
impl UnwindSafe for StreamWorkerCmd
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Decodable for T where
T: DeserializeOwned,
impl<T> Decodable for T where
T: DeserializeOwned,
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
sourcefn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
T: Future, type Output = <T as Future>::Output;
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more