[−][src]Struct milter::Context
Context supplied to the milter callbacks.
The Context<T>
struct provides access to the context API via its api
field. It also provides access to connection-local user data
, the type
of which is T
.
Safety
The type parameter T
specifies the type of the value to be retrieved from
the data
handle. Retrieving the data is potentially an unsafe operation,
as the data needs to be materialised from a raw C pointer. Take care not to
introduce a mismatch when specifying T
; T
should always be the same type
over the whole callback flow.
Fields
api: ContextApi
An accessor to the API methods operating on this context.
data: DataHandle<T>
A handle on user data associated with this context.
Methods
impl<T> Context<T>
[src]
pub fn new(ptr: *mut SMFICTX) -> Self
[src]
Constructs a new Context
from the milter library-supplied raw context
pointer.
You do not normally need to use new
; a Context
is already supplied
to the callbacks.
Panics
Panics if ptr
is null.
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for Context<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> !Send for Context<T>
impl<T> !Sync for Context<T>
impl<T> Unpin for Context<T>
impl<T> UnwindSafe for Context<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,