pub struct Advertised {
pub via: Via,
pub current: String,
pub values: Vec<(String, String)>,
}Expand description
The mode a set-up response advertised: through which channel, its current value, and every value with the agent’s own name for it.
Fields§
§via: ViaThe channel.
current: StringIts value now.
values: Vec<(String, String)>Each value and the agent’s name for it.
Implementations§
Source§impl Advertised
impl Advertised
Sourcepub fn read(
config_options: &Value,
modes: &Value,
profile: Option<&ModeProfile>,
) -> Option<Self>
pub fn read( config_options: &Value, modes: &Value, profile: Option<&ModeProfile>, ) -> Option<Self>
Reads a set-up response’s configOptions and modes (as JSON). A
profiled agent is read only through its profile’s channel — a missing
config option never falls back to modes. An unprofiled agent is read
from its single select option of category mode, else its modes.
Sourcepub fn name_of(&self, value: &str) -> String
pub fn name_of(&self, value: &str) -> String
The agent’s name for a value, or the value itself.
Sourcepub fn current_in(&self, config_options: &Value) -> Option<String>
pub fn current_in(&self, config_options: &Value) -> Option<String>
The current value of this mode option in a full option list (a
session/set_config_option answer).
Trait Implementations§
Source§impl Clone for Advertised
impl Clone for Advertised
Source§impl Debug for Advertised
impl Debug for Advertised
impl Eq for Advertised
Source§impl PartialEq for Advertised
impl PartialEq for Advertised
impl StructuralPartialEq for Advertised
Auto Trait Implementations§
impl Forget for Advertised
impl Freeze for Advertised
impl RefUnwindSafe for Advertised
impl Send for Advertised
impl Sync for Advertised
impl Unpin for Advertised
impl UnsafeUnpin for Advertised
impl UnwindSafe for Advertised
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Converts this value into a three-state builder argument.
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Converts this value into an optional builder argument.
Creates a shared type from an unshared type.