Skip to main content

ContextualEvidence

Struct ContextualEvidence 

Source
pub struct ContextualEvidence<T, Context> {
    pub inner: T,
    /* private fields */
}
Expand description

Evidence tagged with its collection context.

Context is one of OnlineMonitoringContext or OfflineAnalysisContext (or a custom context type). The tag is zero-cost — PhantomData only.

An ContextualEvidence<T, OnlineMonitoringContext> is a different type from ContextualEvidence<T, OfflineAnalysisContext>, so a function that demands offline evidence cannot accidentally receive an online window.

§Type aliases

See OnlineEvidence and OfflineEvidence for the common case.

This is structure only. See crate::streaming. Graduate to wasm4pm when context-dependent processing must execute.

Fields§

§inner: T

The inner evidence value.

Implementations§

Source§

impl<T> ContextualEvidence<T, OfflineAnalysisContext>

Source

pub fn offline(inner: T) -> Self

Wrap inner as offline (complete-log) evidence.

§Examples
use wasm4pm_compat::streaming::ContextualEvidence;

let ev = ContextualEvidence::offline(42u32);
assert_eq!(ev.inner, 42);
Source§

impl<T> ContextualEvidence<T, OnlineMonitoringContext>

Source

pub fn online(inner: T) -> Self

Wrap inner as online (live-stream) evidence.

§Examples
use wasm4pm_compat::streaming::ContextualEvidence;

let ev = ContextualEvidence::online(42u32);
assert_eq!(ev.inner, 42);

Auto Trait Implementations§

§

impl<T, Context> Freeze for ContextualEvidence<T, Context>
where T: Freeze,

§

impl<T, Context> RefUnwindSafe for ContextualEvidence<T, Context>
where T: RefUnwindSafe, Context: RefUnwindSafe,

§

impl<T, Context> Send for ContextualEvidence<T, Context>
where T: Send, Context: Send,

§

impl<T, Context> Sync for ContextualEvidence<T, Context>
where T: Sync, Context: Sync,

§

impl<T, Context> Unpin for ContextualEvidence<T, Context>
where T: Unpin, Context: Unpin,

§

impl<T, Context> UnsafeUnpin for ContextualEvidence<T, Context>
where T: UnsafeUnpin,

§

impl<T, Context> UnwindSafe for ContextualEvidence<T, Context>
where T: UnwindSafe, Context: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> EvidenceKind for T

Source§

default fn kind_label(&self) -> &'static str

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.