[][src]Trait oxide_auth::endpoint::UniqueValue

pub unsafe trait UniqueValue {
    fn get_unique(&self) -> Option<&str>;
}

Return a reference to value in a collection if it is the only one.

For example, a vector of string like types returns a reference to its first element if there are no other, else it returns None.

If this were done with slices, that would require choosing a particular value type of the underlying slice e.g. [String].

Required methods

fn get_unique(&self) -> Option<&str>

Borrow the unique value reference.

Loading content...

Implementations on Foreign Types

impl UniqueValue for str[src]

impl UniqueValue for String[src]

impl<'a, V: ?Sized> UniqueValue for &'a V where
    V: AsRef<str>, 
[src]

impl<V: UniqueValue> UniqueValue for Option<V>[src]

impl<V: UniqueValue> UniqueValue for [V][src]

impl<V: UniqueValue + ?Sized> UniqueValue for Box<V>[src]

impl<V: UniqueValue + ?Sized> UniqueValue for Rc<V>[src]

impl<V: UniqueValue + ?Sized> UniqueValue for Arc<V>[src]

impl<V: UniqueValue> UniqueValue for Vec<V>[src]

Loading content...

Implementors

impl<'a> UniqueValue for Cow<'a, str>[src]

Loading content...