Struct seify::Args

source ·
pub struct Args { /* private fields */ }
Expand description

Arbitrary arguments and parameters.

Implementations§

source§

impl Args

source

pub fn new() -> Self

Create new, empty Args.

source

pub fn from<S: AsRef<str>>(s: S) -> Result<Self, Error>

Create new, Args.from string

source

pub fn get<V: FromStr<Err = impl Error>>( &self, key: impl AsRef<str>, ) -> Result<V, Error>

Try to get a value of type V that is tried to be parsed from the string mapped by the key.

source

pub fn set<K: Into<String>, V: Into<String>>( &mut self, key: K, value: V, ) -> Option<String>

Map the key the stringified value.

source

pub fn remove<K: AsRef<str>>(&mut self, key: K) -> Option<String>

Remove the key together with its associated value.

source

pub fn iter(&self) -> Iter<'_, String, String>

Iterate over key-value pairs of the Args.

source

pub fn iter_mut(&mut self) -> IterMut<'_, String, String>

Iterate mutably over key-value pairs of the Args.

source

pub fn map(&self) -> &HashMap<String, String>

Get a reference to the underlying HashMap.

source

pub fn merge(&mut self, other: Self)

Merge with another Args struct, consuming it.

source

pub fn deserialize<D: for<'a> Deserialize<'a>>(&self) -> Option<D>

Try to Deserialize a value of type D from the JSON-serialized Args.

Trait Implementations§

source§

impl Clone for Args

source§

fn clone(&self) -> Args

Returns a copy 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 Args

source§

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

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

impl Default for Args

source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for Args

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 Display for Args

source§

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

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

impl From<&Args> for Args

source§

fn from(value: &Args) -> Self

Converts to this type from the input type.
source§

impl From<()> for Args

source§

fn from(_value: ()) -> Self

Converts to this type from the input type.
source§

impl FromStr for Args

§

type Err = Error

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl PartialEq for Args

source§

fn eq(&self, other: &Args) -> 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 Args

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 TryInto<Args> for &String

§

type Error = Error

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

fn try_into(self) -> Result<Args, Self::Error>

Performs the conversion.
source§

impl TryInto<Args> for &str

§

type Error = Error

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

fn try_into(self) -> Result<Args, Self::Error>

Performs the conversion.
source§

impl TryInto<Args> for Option<String>

§

type Error = Error

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

fn try_into(self) -> Result<Args, Self::Error>

Performs the conversion.
source§

impl TryInto<Args> for String

§

type Error = Error

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

fn try_into(self) -> Result<Args, Self::Error>

Performs the conversion.
source§

impl Eq for Args

source§

impl StructuralPartialEq for Args

Auto Trait Implementations§

§

impl Freeze for Args

§

impl RefUnwindSafe for Args

§

impl Send for Args

§

impl Sync for Args

§

impl Unpin for Args

§

impl UnwindSafe for Args

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§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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,

§

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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

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

§

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