Struct StringOption

Source
pub struct StringOption<'a> { /* private fields */ }
Expand description

A config option with a string value.

Implementations§

Source§

impl<'a> StringOption<'a>

Source

pub fn value(&self) -> Cow<'_, str>

Get the value of the option.

Trait Implementations§

Source§

impl<'a> AsRef<dyn BaseConfigOption + 'a> for StringOption<'a>

Source§

fn as_ref(&self) -> &(dyn BaseConfigOption + 'a)

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<'a> BaseConfigOption for StringOption<'a>

Source§

fn name(&self) -> Cow<'_, str>

Get the name of the option.
Source§

fn description(&self) -> Cow<'_, str>

Get the description of the option.
Source§

fn section_name(&self) -> Cow<'_, str>

Get the section name of the section the option belongs to.
Source§

fn config_name(&self) -> Cow<'_, str>

Get the config name the option belongs to.
Source§

fn option_type(&self) -> OptionType

Get the type of the config option
Source§

fn reset(&self, run_callback: bool) -> OptionChanged

Resets the option to its default value.
Source§

fn set(&self, value: &str, run_callback: bool) -> OptionChanged

Set the option using a string. Read more
Source§

fn is_null(&self) -> bool

Is the option undefined/null.
Source§

impl<'a> ConfigOptions for StringOption<'_>

Auto Trait Implementations§

§

impl<'a> Freeze for StringOption<'a>

§

impl<'a> RefUnwindSafe for StringOption<'a>

§

impl<'a> !Send for StringOption<'a>

§

impl<'a> !Sync for StringOption<'a>

§

impl<'a> Unpin for StringOption<'a>

§

impl<'a> UnwindSafe for StringOption<'a>

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> 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, 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.