CompatibilityTable

Struct CompatibilityTable 

Source
pub struct CompatibilityTable { /* private fields */ }
Expand description

A table of options that are supported locally or remotely, and their current state.

Implementations§

Source§

impl CompatibilityTable

Source

pub const ENABLED_LOCAL: u8 = 1u8

Option is locally supported.

Source

pub const ENABLED_REMOTE: u8 = 2u8

Option is remotely supported.

Source

pub const LOCAL_STATE: u8 = 4u8

Option is currently enabled locally.

Source

pub const REMOTE_STATE: u8 = 8u8

Option is currently enabled remotely.

Source

pub fn new() -> Self

Source

pub fn from_options(values: &[(u8, u8)]) -> Self

Create a table with some option values set.

§Arguments

values - A slice of (u8, u8) tuples. The first value is the option code, and the second is the bitmask value for that option.

§Notes

An option bitmask can be generated using the CompatibilityEntry struct, using entry.into_u8().

Source

pub fn support_local(&mut self, option: u8)

Enable local support for an option.

Source

pub fn support_remote(&mut self, option: u8)

Enable remote support for an option.

Source

pub fn support(&mut self, option: u8)

Enable both remote and local support for an option.

Source

pub fn get_option(&self, option: u8) -> CompatibilityEntry

Retrieve a CompatbilityEntry generated from the current state of the option value.

Source

pub fn set_option(&mut self, option: u8, entry: CompatibilityEntry)

Set an option value by getting the bitmask from a CompatibilityEntry.

Source

pub fn reset_states(&mut self)

Reset all negotiated states

Trait Implementations§

Source§

impl Clone for CompatibilityTable

Source§

fn clone(&self) -> CompatibilityTable

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 Default for CompatibilityTable

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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.