[][src]Struct ldap3::controls::RawControl

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.

Implementations

impl RawControl[src]

pub fn parse<T: ControlParser>(&self) -> T[src]

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

impl Clone for RawControl[src]

impl Debug for RawControl[src]

impl<S: AsRef<str>> From<Assertion<S>> for RawControl[src]

impl<T> From<CriticalControl<T>> for RawControl where
    T: Into<RawControl>, 
[src]

impl From<ManageDsaIt> for RawControl[src]

impl From<PagedResults> for RawControl[src]

impl<S: AsRef<str>> From<PostRead<S>> for RawControl[src]

impl<S: AsRef<str>> From<PreRead<S>> for RawControl[src]

impl From<ProxyAuth> for RawControl[src]

impl From<RelaxRules> for RawControl[src]

impl From<SyncRequest> for RawControl[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.