pub struct Context<'x> { /* private fields */ }Implementations§
Source§impl<'x> Context<'x>
impl<'x> Context<'x>
pub fn new( runtime: &'x Runtime, message: Message<'x>, script: &'x Sieve<'x>, arena: &'x mut Arena, ) -> Self
pub fn run<H: Handler<'x>>( &mut self, handler: &mut H, ) -> Result<Status, RuntimeError>
pub fn resume(&mut self, input: impl Into<Input<'x>>)
pub fn set_envelope( &mut self, envelope: impl TryInto<Envelope>, value: impl Into<Cow<'x, str>>, )
pub fn with_vars_env( self, vars_env: AHashMap<Cow<'static, str>, Variable<'x>>, ) -> Self
pub fn with_envelope_list(self, envelope: Vec<(Envelope, Variable<'x>)>) -> Self
pub fn with_envelope( self, envelope: impl TryInto<Envelope>, value: impl Into<Cow<'x, str>>, ) -> Self
pub fn clear_envelope(&mut self)
pub fn set_user_address(&mut self, from: impl Into<Cow<'x, str>>)
pub fn with_user_address(self, from: impl Into<Cow<'x, str>>) -> Self
pub fn set_user_full_name(&mut self, name: &str)
pub fn with_user_full_name(self, name: &str) -> Self
pub fn set_env_variable( &mut self, name: impl Into<Cow<'static, str>>, value: impl Into<Variable<'x>>, )
pub fn with_env_variable( self, name: impl Into<Cow<'static, str>>, value: impl Into<Variable<'x>>, ) -> Self
pub fn set_global_variable( &mut self, name: impl Into<Cow<'static, str>>, value: impl Into<Variable<'x>>, )
pub fn with_global_variable( self, name: impl Into<Cow<'static, str>>, value: impl Into<Variable<'x>>, ) -> Self
pub fn set_medatata( &mut self, name: impl Into<Metadata<String>>, value: impl Into<Cow<'x, str>>, )
pub fn with_metadata( self, name: impl Into<Metadata<String>>, value: impl Into<Cow<'x, str>>, ) -> Self
pub fn set_spam_status(&mut self, status: impl Into<SpamStatus>)
pub fn with_spam_status(self, status: impl Into<SpamStatus>) -> Self
pub fn set_virus_status(&mut self, status: impl Into<VirusStatus>)
pub fn with_virus_status(self, status: impl Into<VirusStatus>) -> Self
pub fn set_current_time(&mut self, time: i64)
pub fn with_current_time(self, time: i64) -> Self
pub fn take_message(&mut self) -> Message<'x>
pub fn has_message_changed(&self) -> bool
pub fn global_variable_names(&self) -> impl Iterator<Item = &str>
pub fn global_variable(&self, name: &str) -> Option<&Variable<'_>>
pub fn message(&self) -> &Message<'x>
pub fn part(&self) -> u32
pub fn runtime(&self) -> &'x Runtime
pub fn instructions_executed(&self) -> usize
Source§impl<'x> Context<'x>
impl<'x> Context<'x>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more