Struct ldap3::controls::RawControl
[−]
[src]
pub struct RawControl { pub ctype: String, pub crit: bool, pub val: Option<Vec<u8>>, }
Generic control.
This struct can be used both for request and response controls. For requests, an
independently implemented control can produce an instance of this type and use it
to provide an element of the vector passed to with_controls()
by calling into()
on the instance.
For responses, an instance is packed into a Control
and
can be parsed by calling type-qualified parse()
on that instance,
if a ControlParser
implementation exists for the
specified type.
Fields
ctype: String
OID of the control.
crit: bool
Criticality, has no meaning on response.
val: Option<Vec<u8>>
Raw value of the control, if any.
Methods
impl RawControl
[src]
fn parse<T: ControlParser>(&self) -> T
Parse the generic control into a control-specific struct.
The parser will panic if the control value is None
.
Note: no control known to the author signals the lack of return value by
omitting the control value, so this shouldn't be a problem in practice.
Nevertheless, it should be possible to report this along with other parsing errors,
which is a planned future improvement.
Trait Implementations
impl<S: AsRef<str>> From<Assertion<S>> for RawControl
[src]
fn from(assn: Assertion<S>) -> RawControl
Performs the conversion.
impl From<PagedResults> for RawControl
[src]
fn from(pr: PagedResults) -> RawControl
Performs the conversion.
impl From<ProxyAuth> for RawControl
[src]
fn from(pa: ProxyAuth) -> RawControl
Performs the conversion.
impl<S: AsRef<str>> From<PreRead<S>> for RawControl
[src]
fn from(pr: PreRead<S>) -> RawControl
Performs the conversion.
impl<S: AsRef<str>> From<PostRead<S>> for RawControl
[src]
fn from(pr: PostRead<S>) -> RawControl
Performs the conversion.
impl From<RelaxRules> for RawControl
[src]
fn from(_rr: RelaxRules) -> RawControl
Performs the conversion.
impl<T> From<CriticalControl<T>> for RawControl where
T: Into<RawControl>,
[src]
T: Into<RawControl>,
fn from(cc: CriticalControl<T>) -> RawControl
Performs the conversion.
impl Clone for RawControl
[src]
fn clone(&self) -> RawControl
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more