Struct 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

Source

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

Source§

fn clone(&self) -> RawControl

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RawControl

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<S: AsRef<str>> From<Assertion<S>> for RawControl

Source§

fn from(assn: Assertion<S>) -> RawControl

Converts to this type from the input type.
Source§

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

Source§

fn from(cc: CriticalControl<T>) -> RawControl

Converts to this type from the input type.
Source§

impl From<ManageDsaIt> for RawControl

Source§

fn from(_mdi: ManageDsaIt) -> RawControl

Converts to this type from the input type.
Source§

impl<S: AsRef<str>> From<MatchedValues<S>> for RawControl

Source§

fn from(assn: MatchedValues<S>) -> RawControl

Converts to this type from the input type.
Source§

impl From<PagedResults> for RawControl

Source§

fn from(pr: PagedResults) -> RawControl

Converts to this type from the input type.
Source§

impl<S: AsRef<str>> From<PostRead<S>> for RawControl

Source§

fn from(pr: PostRead<S>) -> RawControl

Converts to this type from the input type.
Source§

impl<S: AsRef<str>> From<PreRead<S>> for RawControl

Source§

fn from(pr: PreRead<S>) -> RawControl

Converts to this type from the input type.
Source§

impl From<ProxyAuth> for RawControl

Source§

fn from(pa: ProxyAuth) -> RawControl

Converts to this type from the input type.
Source§

impl From<RelaxRules> for RawControl

Source§

fn from(_rr: RelaxRules) -> RawControl

Converts to this type from the input type.
Source§

impl From<SyncRequest> for RawControl

Source§

fn from(sr: SyncRequest) -> RawControl

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<R> IntoRawControlVec for R
where RawControl: From<R>,

Source§

fn into(self) -> Vec<RawControl>

Create a control vector.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,