Struct indicator::context::value::Value

source ·
pub struct Value<T> { /* private fields */ }
Expand description

Value with context.

Implementations§

source§

impl<T> Value<T>

source

pub fn value(&self) -> &T

Get the reference to the inner value.

source

pub fn value_mut(&mut self) -> &mut T

Get the mutable reference to the inner value.

source

pub fn context(&self) -> &Context

Get the reference to the context.

source

pub fn context_mut(&mut self) -> &mut Context

Get the mutable reference to the context.

source

pub fn apply(&mut self, f: impl FnOnce(&mut T, &mut Context))

Apply a closure to the inner value and the context.

source

pub fn map<U>(self, f: impl FnOnce(T, &mut Context) -> U) -> Value<U>

Convert the inner value.

source

pub fn as_ref(&self) -> ValueRef<'_, T>

Create a reference to the value.

Trait Implementations§

source§

impl<T: Debug> Debug for Value<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T, I, P> Operator<Value<I>> for AddDataOperator<T, P>where P: ContextOperator<I>, T: Send + Sync + 'static,

§

type Output = Value<<P as ContextOperator<I>>::Out>

Output type.
source§

fn next(&mut self, input: Value<I>) -> Self::Output

Produce the next output.
source§

impl<I, O, F> Operator<Value<I>> for Output<F>where F: FnMut(I, &mut Context) -> O,

§

type Output = Value<O>

Output type.
source§

fn next(&mut self, input: Value<I>) -> Self::Output

Produce the next output.
source§

impl<In, Out, A, B> Operator<Value<In>> for Either<A, B>where A: ContextOperator<In, Out = Out>, B: ContextOperator<In, Out = Out>,

§

type Output = Value<Out>

Output type.
source§

fn next(&mut self, input: Value<In>) -> Self::Output

Produce the next output.
source§

impl<T, P> Operator<Value<T>> for CacheOperator<P>where P: ContextOperator<T>,

§

type Output = Value<<P as ContextOperator<T>>::Out>

Output type.
source§

fn next(&mut self, input: Value<T>) -> Self::Output

Produce the next output.
source§

impl<T> Operator<Value<T>> for Input<T>

§

type Output = Value<T>

Output type.
source§

fn next(&mut self, input: Value<T>) -> Self::Output

Produce the next output.
source§

impl<T, R, Out, Data> Operator<Value<T>> for InsertAndOutput<R>where R: for<'a> RefOperator<'a, T, Output = (Out, Option<Data>)>, Out: Clone + Send + Sync + 'static, Data: Send + Sync + 'static,

§

type Output = Value<Out>

Output type.
source§

fn next(&mut self, input: Value<T>) -> Self::Output

Produce the next output.
source§

impl<T, P, R, Out> Operator<Value<T>> for InsertDataOperator<P, R>where P: ContextOperator<T>, R: for<'a> RefOperator<'a, T, Output = Option<Out>>, Out: Send + Sync + 'static,

§

type Output = Value<<P as ContextOperator<T>>::Out>

Output type.
source§

fn next(&mut self, input: Value<T>) -> Self::Output

Produce the next output.
source§

impl<T, R, Out> Operator<Value<T>> for InsertEnvAndOutput<R>where R: for<'a> RefOperator<'a, T, Output = Out>, Out: Clone + Send + Sync + 'static,

§

type Output = Value<Out>

Output type.
source§

fn next(&mut self, input: Value<T>) -> Self::Output

Produce the next output.
source§

impl<T, P, R, Out> Operator<Value<T>> for InsertOperator<P, R>where P: ContextOperator<T>, R: for<'a> RefOperator<'a, T, Output = Out>, Out: Send + Sync + 'static,

§

type Output = Value<<P as ContextOperator<T>>::Out>

Output type.
source§

fn next(&mut self, input: Value<T>) -> Self::Output

Produce the next output.
source§

impl<T, P, R, Env, Data> Operator<Value<T>> for InsertWithDataOperator<P, R>where P: ContextOperator<T>, R: for<'a> RefOperator<'a, T, Output = (Env, Option<Data>)>, Env: Send + Sync + 'static, Data: Send + Sync + 'static,

§

type Output = Value<<P as ContextOperator<T>>::Out>

Output type.
source§

fn next(&mut self, input: Value<T>) -> Self::Output

Produce the next output.

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for Value<T>

§

impl<T> Send for Value<T>where T: Send,

§

impl<T> Sync for Value<T>where T: Sync,

§

impl<T> Unpin for Value<T>where T: Unpin,

§

impl<T> !UnwindSafe for Value<T>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.