Struct sieve::Context

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

Implementations§

source§

impl<'x> Context<'x>

source

pub fn run(&mut self, input: Input) -> Option<Result<Event, RuntimeError>>

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> ) -> Self

source

pub fn with_envelope_list(self, envelope: Vec<(Envelope, Variable)>) -> 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> )

source

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

source

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

source

pub fn with_global_variable( self, name: impl Into<Cow<'static, str>>, value: impl Into<Variable> ) -> 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 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) -> usize

Trait Implementations§

source§

impl<'x> Clone for Context<'x>

source§

fn clone(&self) -> Context<'x>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'x> Debug for Context<'x>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

impl<'x> UnwindSafe 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<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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where 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 T
where 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.