Skip to main content

Context

Struct Context 

Source
pub struct Context<'x> { /* private fields */ }

Implementations§

Source§

impl<'x> Context<'x>

Source

pub fn new( runtime: &'x Runtime, message: Message<'x>, script: &'x Sieve<'x>, arena: &'x mut Arena, ) -> Self

Source

pub fn run<H: Handler<'x>>( &mut self, handler: &mut H, ) -> Result<Status, RuntimeError>

Source

pub fn resume(&mut self, input: impl Into<Input<'x>>)

Source

pub fn set_envelope( &mut self, envelope: impl TryInto<Envelope>, value: impl Into<Cow<'x, str>>, )

Source

pub fn with_vars_env( self, vars_env: AHashMap<Cow<'static, str>, Variable<'x>>, ) -> Self

Source

pub fn with_envelope_list(self, envelope: Vec<(Envelope, Variable<'x>)>) -> Self

Source

pub fn with_envelope( self, envelope: impl TryInto<Envelope>, value: impl Into<Cow<'x, str>>, ) -> Self

Source

pub fn clear_envelope(&mut self)

Source

pub fn set_user_address(&mut self, from: impl Into<Cow<'x, str>>)

Source

pub fn with_user_address(self, from: impl Into<Cow<'x, str>>) -> Self

Source

pub fn set_user_full_name(&mut self, name: &str)

Source

pub fn with_user_full_name(self, name: &str) -> Self

Source

pub fn set_env_variable( &mut self, name: impl Into<Cow<'static, str>>, value: impl Into<Variable<'x>>, )

Source

pub fn with_env_variable( self, name: impl Into<Cow<'static, str>>, value: impl Into<Variable<'x>>, ) -> Self

Source

pub fn set_global_variable( &mut self, name: impl Into<Cow<'static, str>>, value: impl Into<Variable<'x>>, )

Source

pub fn with_global_variable( self, name: impl Into<Cow<'static, str>>, value: impl Into<Variable<'x>>, ) -> Self

Source

pub fn set_medatata( &mut self, name: impl Into<Metadata<String>>, value: impl Into<Cow<'x, str>>, )

Source

pub fn with_metadata( self, name: impl Into<Metadata<String>>, value: impl Into<Cow<'x, str>>, ) -> Self

Source

pub fn set_spam_status(&mut self, status: impl Into<SpamStatus>)

Source

pub fn with_spam_status(self, status: impl Into<SpamStatus>) -> Self

Source

pub fn set_virus_status(&mut self, status: impl Into<VirusStatus>)

Source

pub fn with_virus_status(self, status: impl Into<VirusStatus>) -> Self

Source

pub fn set_current_time(&mut self, time: i64)

Source

pub fn with_current_time(self, time: i64) -> Self

Source

pub fn take_message(&mut self) -> Message<'x>

Source

pub fn has_message_changed(&self) -> bool

Source

pub fn global_variable_names(&self) -> impl Iterator<Item = &str>

Source

pub fn global_variable(&self, name: &str) -> Option<&Variable<'_>>

Source

pub fn message(&self) -> &Message<'x>

Source

pub fn part(&self) -> u32

Source

pub fn runtime(&self) -> &'x Runtime

Source

pub fn instructions_executed(&self) -> usize

Source§

impl<'x> Context<'x>

Source

pub fn received_part( &self, part: &ReceivedPart, rcvd: &Received<'x>, ) -> Option<Variable<'x>>

Auto Trait Implementations§

§

impl<'x> !Freeze for Context<'x>

§

impl<'x> !RefUnwindSafe for Context<'x>

§

impl<'x> !Sync for Context<'x>

§

impl<'x> !UnwindSafe for Context<'x>

§

impl<'x> Send for Context<'x>

§

impl<'x> Unpin for Context<'x>

§

impl<'x> UnsafeUnpin for Context<'x>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.