Enum Options

Source
pub enum Options {
    None,
    PubKey(PubKey),
    PeerId(PeerId),
    PrevSig(PrevSig),
    Kind(Kind),
    Name(Name),
    IPv4(AddressV4),
    IPv6(AddressV6),
    Issued(Issued),
    Expiry(Expiry),
    Limit(Limit),
    Metadata(Metadata),
}
Expand description

DSF defined options fields

Variants§

§

None

§

PubKey(PubKey)

§

PeerId(PeerId)

§

PrevSig(PrevSig)

§

Kind(Kind)

§

Name(Name)

§

IPv4(AddressV4)

§

IPv6(AddressV6)

§

Issued(Issued)

§

Expiry(Expiry)

§

Limit(Limit)

§

Metadata(Metadata)

Implementations§

Source§

impl Options

Source

pub fn parse_vec(data: &[u8]) -> Result<(Vec<Options>, usize), OptionsError>

Parse a bounded list of options into a vector

Source

pub fn encode_vec( options: &[Options], data: &mut [u8], ) -> Result<usize, OptionsError>

Encode a vector of options

Source§

impl Options

Source

pub fn name(value: &str) -> Options

Source

pub fn kind(value: &str) -> Options

Source

pub fn prev_sig(value: &Signature) -> Options

Source

pub fn meta(key: &str, value: &str) -> Options

Source

pub fn issued<T: Into<DateTime>>(now: T) -> Options

Source

pub fn expiry<T: Into<DateTime>>(when: T) -> Options

Source

pub fn peer_id(id: Id) -> Options

Source

pub fn public_key(public_key: PublicKey) -> Options

Source

pub fn address<T: Into<Address>>(address: T) -> Options

Source

pub fn address_v4<T: Into<AddressV4>>(address: T) -> Options

Source

pub fn address_v6<T: Into<AddressV6>>(address: T) -> Options

Source

pub fn pub_key(public_key: PublicKey) -> Options

Trait Implementations§

Source§

impl Clone for Options

Source§

fn clone(&self) -> Options

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 Options

Source§

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

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

impl<'de> Deserialize<'de> for Options

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Encode for Options

Source§

type Error = OptionsError

Error type returned on parse error
Source§

fn encode(&self, data: &mut [u8]) -> Result<usize, Self::Error>

Encode method writes object data to the provided writer
Source§

fn encode_iter<'a, V: Iterator<Item = &'a Self>>( vals: V, buff: &mut [u8], ) -> Result<usize, Self::Error>
where Self: 'static,

Encode a iterator of encodable objects
Source§

impl From<Metadata> for Options

Source§

fn from(m: Metadata) -> Options

Converts to this type from the input type.
Source§

impl Parse for Options

Parse parses a control option from the given scope

Source§

type Output = Options

Output type returned from parsing
Source§

type Error = OptionsError

Error type returned on parse error
Source§

fn parse<'a>(data: &'a [u8]) -> Result<(Self::Output, usize), Self::Error>

Parse method consumes a slice and returns an object and the remaining slice.
Source§

fn parse_iter<'a>(buff: &'a [u8]) -> ParseIter<'a, Self::Output, Self::Error>

Parse iter consumes a slice and returns an iterator over decoded objects
Source§

impl PartialEq for Options

Source§

fn eq(&self, other: &Options) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Options

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Options

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<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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,