Struct milter::Context [−][src]
pub struct Context<T> {
pub api: ContextApi,
pub data: DataHandle<T>,
}
Expand description
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. Retrieval of the data uses unsafe
code, as the data
needs to be materialised from a raw C pointer. Take care not to introduce a
mismatch when specifying T
; T
must 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.