Struct roa_core::Variable[][src]

pub struct Variable<'a, V> { /* fields omitted */ }

A wrapper of Arc.

Deref

use roa_core::Variable;

fn consume<V>(var: Variable<V>) {
    let value: &V = &var;
}

Parse

use roa_core::{Variable, Result};

fn consume<V: AsRef<str>>(var: Variable<V>) -> Result {
    let value: i32 = var.parse()?;
    Ok(())
}

Implementations

impl<'a, V> Variable<'a, V>[src]

pub fn value(self) -> Arc<V>[src]

Consume self and get inner Arc.

impl<V> Variable<'_, V> where
    V: AsRef<str>, 
[src]

pub fn parse<T>(&self) -> Result<T, Status> where
    T: FromStr,
    T::Err: Display
[src]

A wrapper of str::parse. Converts T::FromStr::Err to roa_core::Error automatically.

Trait Implementations

impl<'a, V: Clone> Clone for Variable<'a, V>[src]

impl<'a, V: Debug> Debug for Variable<'a, V>[src]

impl<V> Deref for Variable<'_, V>[src]

type Target = V

The resulting type after dereferencing.

Auto Trait Implementations

impl<'a, V> RefUnwindSafe for Variable<'a, V> where
    V: RefUnwindSafe

impl<'a, V> Send for Variable<'a, V> where
    V: Send + Sync

impl<'a, V> Sync for Variable<'a, V> where
    V: Send + Sync

impl<'a, V> Unpin for Variable<'a, V>

impl<'a, V> UnwindSafe for Variable<'a, V> where
    V: RefUnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.