Struct rsasl::session::Session [−][src]
pub struct Session<D> { /* fields omitted */ }
Expand description
The context of an authentication exchange
This struct will call the necesarry initializers on construction and finalizers when
discarded
. If manual housekeeping is required the session can be leaked with
DiscardOnDrop::leak
.
Implementations
Perform one step of SASL authentication. This reads data from input
then processes it,
potentially calling a configured callback for required properties or enact decisions, and
finally returns data to be send to the other party.
Note: This function may leak memory on internal failure.
A simple wrapper around the gsasl step function that base64-decodes the input and base64-encodes the output. Mainly useful for text-based protocols.
Note: This function may leak memory on failure since the internal step function does as well.
Set a property in the session context
A property
in this context is a piece of information used by authentication mechanisms,
for example the Authcid, Authzid and Password for PLAIN.
This is the Rust equivalent to the gsasl_property_set
funciton.
Try to read a property from the session context
This maps to gsasl_property_fast
meaning it will not call the callback to retrieve
properties it does not know about.
Returns None
if the property is now known or was not set
Store some data in the Session context
This allows a callback to later access that data using retrieve
or retrieve_mut
Retrieve the data stored with store
, leaving nothing in its place
This function will return None
if no data was stored. This function is unsafe because we
can not guarantee that there is currently nothing else that has a reference to the data
which will turn into a dangling pointer if the returned Box is dropped
Retrieve a mutable reference to the data stored with store
This is an alternative to retrieve_raw
that does not take ownership of the stored data,
thus also not dropping it after it has left the current scope.
The function tries to return None
if no data was stored.