Skip to main content

ContextView

Struct ContextView 

Source
pub struct ContextView<'v> { /* private fields */ }
Expand description

The message context converted into the arena once, for evaluating several expressions against it. Built by TaskContext::with_view.

Each method evaluates exactly as its TaskContext namesake does, with the same errors, but against this one conversion instead of a fresh one.

Implementations§

Source§

impl ContextView<'_>

Source

pub fn eval(&self, logic: &Logic) -> Result<OwnedDataValue>

As TaskContext::eval, against this view.

§Errors

As TaskContext::eval.

Source

pub fn eval_json(&self, logic: &Logic) -> Result<JsonValue>

As TaskContext::eval_json, against this view.

§Errors

As TaskContext::eval.

Source

pub fn eval_to_plain_string(&self, logic: &Logic) -> Result<String>

As TaskContext::eval_to_plain_string, against this view: a string result yields its contents, anything else its compact JSON form.

§Errors

As TaskContext::eval.

Auto Trait Implementations§

§

impl<'v> !RefUnwindSafe for ContextView<'v>

§

impl<'v> !Send for ContextView<'v>

§

impl<'v> !Sync for ContextView<'v>

§

impl<'v> !UnwindSafe for ContextView<'v>

§

impl<'v> Freeze for ContextView<'v>

§

impl<'v> Unpin for ContextView<'v>

§

impl<'v> UnsafeUnpin for ContextView<'v>

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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.