Struct ldap3::controls::RawControl
source · pub struct RawControl {
pub ctype: String,
pub crit: bool,
pub val: Option<Vec<u8>>,
}
Expand description
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.
Implementations§
source§impl RawControl
impl RawControl
sourcepub fn parse<T: ControlParser>(&self) -> T
pub 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,
if it proves necessary.
Trait Implementations§
source§impl Clone for RawControl
impl Clone for RawControl
source§fn clone(&self) -> RawControl
fn clone(&self) -> RawControl
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more