pub struct TestEnvelope<Payload> {
pub position: u64,
pub persistence_id: PersistenceId,
pub sequence_nr: SequenceNr,
pub payload: Payload,
}Expand description
In-process envelope used by TestSourceProvider.
Fields§
§position: u64Provider-global ordered position. Multiple persistence ids may share it.
persistence_id: PersistenceIdPersistent entity identity used by boundary deduplication.
sequence_nr: SequenceNrEntity-local sequence number used by boundary deduplication.
payload: PayloadTest-defined handler payload.
Implementations§
Source§impl<Payload> TestEnvelope<Payload>
impl<Payload> TestEnvelope<Payload>
Sourcepub fn new(
position: u64,
persistence_id: PersistenceId,
sequence_nr: SequenceNr,
payload: Payload,
) -> Self
pub fn new( position: u64, persistence_id: PersistenceId, sequence_nr: SequenceNr, payload: Payload, ) -> Self
Creates a test envelope at a provider position.
Trait Implementations§
Source§impl<Payload: Clone> Clone for TestEnvelope<Payload>
impl<Payload: Clone> Clone for TestEnvelope<Payload>
Source§impl<Payload: Debug> Debug for TestEnvelope<Payload>
impl<Payload: Debug> Debug for TestEnvelope<Payload>
impl<Payload: Eq> Eq for TestEnvelope<Payload>
Source§impl<Payload: PartialEq> PartialEq for TestEnvelope<Payload>
impl<Payload: PartialEq> PartialEq for TestEnvelope<Payload>
Source§impl<Payload> SourceProvider<TestEnvelope<Payload>> for TestSourceProvider<Payload>
impl<Payload> SourceProvider<TestEnvelope<Payload>> for TestSourceProvider<Payload>
Source§fn manifest(&self) -> &ProviderManifest
fn manifest(&self) -> &ProviderManifest
Returns the stable durable identity of this provider and cursor format.
Source§fn source_from<'life0, 'life1, 'async_trait>(
&'life0 self,
cursor: Option<&'life1 ProjectionCursor>,
mode: QueryMode,
) -> Pin<Box<dyn Future<Output = ProjectionResult<ProjectionSource<TestEnvelope<Payload>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn source_from<'life0, 'life1, 'async_trait>(
&'life0 self,
cursor: Option<&'life1 ProjectionCursor>,
mode: QueryMode,
) -> Pin<Box<dyn Future<Output = ProjectionResult<ProjectionSource<TestEnvelope<Payload>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Materializes a fresh source beginning at
cursor. Read moreSource§fn extract_cursor(
&self,
envelope: &TestEnvelope<Payload>,
) -> ProjectionResult<ProjectionCursor>
fn extract_cursor( &self, envelope: &TestEnvelope<Payload>, ) -> ProjectionResult<ProjectionCursor>
Extracts the complete durable cursor after processing
envelope. Read moreSource§fn compare_positions(
&self,
left: &CursorPosition,
right: &CursorPosition,
) -> ProjectionResult<CmpOrdering>
fn compare_positions( &self, left: &CursorPosition, right: &CursorPosition, ) -> ProjectionResult<CmpOrdering>
Compares two opaque provider positions in source order. Read more
Source§fn validate_projection_id(
&self,
_projection_id: &ProjectionId,
) -> ProjectionResult<()>
fn validate_projection_id( &self, _projection_id: &ProjectionId, ) -> ProjectionResult<()>
Validates that this provider may run under
projection_id. Read moreSource§fn resume_allows(
&self,
cursor: &ProjectionCursor,
envelope: &Envelope,
) -> ProjectionResult<bool>
fn resume_allows( &self, cursor: &ProjectionCursor, envelope: &Envelope, ) -> ProjectionResult<bool>
Decides whether
envelope is after the already-consumed resume cursor. Read moreimpl<Payload: PartialEq> StructuralPartialEq for TestEnvelope<Payload>
Auto Trait Implementations§
impl<Payload> Freeze for TestEnvelope<Payload>where
Payload: Freeze,
impl<Payload> RefUnwindSafe for TestEnvelope<Payload>where
Payload: RefUnwindSafe,
impl<Payload> Send for TestEnvelope<Payload>where
Payload: Send,
impl<Payload> Sync for TestEnvelope<Payload>where
Payload: Sync,
impl<Payload> Unpin for TestEnvelope<Payload>where
Payload: Unpin,
impl<Payload> UnsafeUnpin for TestEnvelope<Payload>where
Payload: UnsafeUnpin,
impl<Payload> UnwindSafe for TestEnvelope<Payload>where
Payload: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<S> IntoEventHandlerResult<S> for S
impl<S> IntoEventHandlerResult<S> for S
Source§fn into_event_handler_result(self) -> Result<S, PersistenceError>
fn into_event_handler_result(self) -> Result<S, PersistenceError>
Converts this handler output into the runtime result.
Source§impl<T> Message for T
impl<T> Message for T
Source§fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
Convert a BoxedMessage to this concrete type
Source§fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
Convert this message to a BoxedMessage