pub struct Condition<I> { /* private fields */ }Expand description
Condition.
Conditions are used to determine whether a Barrier contains a specific
identifier. They implement Value, so they can be created and returned by
any Operator. The resulting Stream of conditions can be used in
any operator that expects conditions, such as Stream::select.
§Examples
use zrx_stream::barrier::Condition;
// Create condition and test identifier
let condition = Condition::new(|&id: &i32| id < 100);
assert!(condition.satisfies(&42));Implementations§
Trait Implementations§
impl<I> Value for Condition<I>where
I: Id,
Auto Trait Implementations§
impl<I> Freeze for Condition<I>
impl<I> !RefUnwindSafe for Condition<I>
impl<I> Send for Condition<I>
impl<I> Sync for Condition<I>
impl<I> Unpin for Condition<I>
impl<I> !UnwindSafe for Condition<I>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<T> IntoReport<T> for Twhere
T: Value,
impl<T> IntoReport<T> for Twhere
T: Value,
Source§impl<T, E> IntoReport<T, E> for Twhere
E: Error,
impl<T, E> IntoReport<T, E> for Twhere
E: Error,
Source§fn into_report(self) -> Result<Report<T>, E>
fn into_report(self) -> Result<Report<T>, E>
Creates a report from a value T and wraps it in a result.
§Examples
use std::io::Error;
use zrx_diagnostic::report::IntoReport;
// Define function returning a value
fn f() -> impl IntoReport<i32, Error> {
42
}
// Invoke function and create report
let res = f().into_report();