SdOption

Enum SdOption 

Source
pub enum SdOption {
    Configuration(ConfigurationOption),
    LoadBalancing(LoadBalancingOption),
    Ipv4Endpoint(Ipv4EndpointOption),
    Ipv6Endpoint(Ipv6EndpointOption),
    Ipv4Multicast(Ipv4MulticastOption),
    Ipv6Multicast(Ipv6MulticastOption),
    Ipv4SdEndpoint(Ipv4SdEndpointOption),
    Ipv6SdEndpoint(Ipv6SdEndpointOption),
    UnknownDiscardable(UnknownDiscardableOption),
}

Variants§

§

Configuration(ConfigurationOption)

Arbitrary configuration strings.

§

LoadBalancing(LoadBalancingOption)

§

Ipv4Endpoint(Ipv4EndpointOption)

§

Ipv6Endpoint(Ipv6EndpointOption)

§

Ipv4Multicast(Ipv4MulticastOption)

§

Ipv6Multicast(Ipv6MulticastOption)

§

Ipv4SdEndpoint(Ipv4SdEndpointOption)

§

Ipv6SdEndpoint(Ipv6SdEndpointOption)

§

UnknownDiscardable(UnknownDiscardableOption)

An unknown option that is flagged as “discardable” and should be ignored by the receiver if not supported.

This option is only intended to be used for reading, to ensure the option indices are still matching. In case this option is passed to a write function an error will be triggered.

Implementations§

Source§

impl SdOption

Source

pub fn read<T: Read + Seek>(reader: &mut T) -> Result<(u16, Self), SdReadError>

Read the value from a std::io::Read source.

Source

pub fn read_with_flag<T: Read + Seek>( reader: &mut T, discard_unknown_option: bool, ) -> Result<(u16, Self), SdReadError>

Read the value from a std::io::Read source.

Source

pub fn write<T: Write>(&self, writer: &mut T) -> Result<(), SdWriteError>

Writes the eventgroup entry to the given writer.

Source

pub fn append_bytes_to_vec( &self, buffer: &mut Vec<u8>, ) -> Result<(), SdValueError>

Serializes option and append data to a vec

Source

pub fn header_len(&self) -> usize

Length of the serialized header in bytes.

Trait Implementations§

Source§

impl Clone for SdOption

Source§

fn clone(&self) -> SdOption

Returns a duplicate of the value. Read more
1.0.0§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for SdOption

Source§

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

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

impl From<ConfigurationOption> for SdOption

Source§

fn from(o: ConfigurationOption) -> Self

Converts to this type from the input type.
Source§

impl From<Ipv4EndpointOption> for SdOption

Source§

fn from(o: Ipv4EndpointOption) -> Self

Converts to this type from the input type.
Source§

impl From<Ipv4MulticastOption> for SdOption

Source§

fn from(o: Ipv4MulticastOption) -> Self

Converts to this type from the input type.
Source§

impl From<Ipv4SdEndpointOption> for SdOption

Source§

fn from(o: Ipv4SdEndpointOption) -> Self

Converts to this type from the input type.
Source§

impl From<Ipv6EndpointOption> for SdOption

Source§

fn from(o: Ipv6EndpointOption) -> Self

Converts to this type from the input type.
Source§

impl From<Ipv6MulticastOption> for SdOption

Source§

fn from(o: Ipv6MulticastOption) -> Self

Converts to this type from the input type.
Source§

impl From<Ipv6SdEndpointOption> for SdOption

Source§

fn from(o: Ipv6SdEndpointOption) -> Self

Converts to this type from the input type.
Source§

impl From<LoadBalancingOption> for SdOption

Source§

fn from(o: LoadBalancingOption) -> Self

Converts to this type from the input type.
Source§

impl From<UnknownDiscardableOption> for SdOption

Source§

fn from(o: UnknownDiscardableOption) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for SdOption

Source§

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

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

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 Eq for SdOption

Source§

impl StructuralPartialEq for SdOption

Auto Trait Implementations§

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

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

§

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
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

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

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

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

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.