[][src]Struct oceanpkg::drop::name::scoped::ScopedName

#[repr(C)]
pub struct ScopedName<Name = String> {
    pub scope: Name,
    pub name: Name,
}

Name in the format <owner>/<drop>.

Fields

scope: Name

The namespace of the drop.

name: Name

The drop's given name.

Methods

impl<N> ScopedName<N>[src]

pub fn new<A, B>(scope: A, name: B) -> Self where
    A: Into<N>,
    B: Into<N>, 
[src]

Creates a new instance from scope and name.

pub fn parse<A, NE>(name: A) -> Result<Self, ParseError<NE>> where
    A: TryInto<Self, Error = ParseError<NE>>, 
[src]

Attempts to create a new instance by parsing name.

pub fn cast<A>(self) -> ScopedName<A> where
    N: Into<A>, 
[src]

Converts self into a new ScopedName by performing an Into conversion over all fields.

pub fn try_cast<A>(self) -> Result<ScopedName<A>, ParseError<N::Error>> where
    N: TryInto<A>, 
[src]

Converts self into a new Query by performing an Into conversion over all fields.

pub fn as_ref(&self) -> ScopedName<&N>[src]

Takes shared references to the fields of this name.

pub fn to_ref<A>(&self) -> ScopedName<&A> where
    N: AsRef<A>,
    A: ?Sized
[src]

Takes a shared reference to the fields of this name as type A.

pub fn as_mut(&mut self) -> ScopedName<&mut N>[src]

Takes mutable references to the fields of this name.

pub fn to_mut<A>(&mut self) -> ScopedName<&mut A> where
    N: AsMut<A>,
    A: ?Sized
[src]

Takes a mutable references to the fields of this name as type A.

pub fn map<A, F>(self, f: F) -> ScopedName<A> where
    F: FnMut(N) -> A, 
[src]

Creates a new ScopedName by mapping the function over the fields of self.

pub fn into_query(self) -> Query<N>[src]

Converts self into a Query.

pub fn into_query_with<V>(self, version: V) -> Query<N, V>[src]

Converts self into a Query with the specified version.

pub fn as_names_array(&self) -> &[N; 2][src]

Converts self into an array of names.

pub fn as_names_slice(&self) -> &[N][src]

Converts self into a slice of names.

impl<'n, N: ?Sized> ScopedName<&'n N>[src]

pub fn cloned(&self) -> ScopedName<N> where
    N: Clone
[src]

Returns the result of calling Clone::clone on the fields of self.

pub fn to_owned(&self) -> ScopedName<N::Owned> where
    N: ToOwned
[src]

Returns the result of calling ToOwned::to_owned on the fields of self.

Examples

use oceanpkg::drop::name::ScopedName;

let name:  ScopedName<&str>   = ScopedName::new("core", "wget");
let owned: ScopedName<String> = name.to_owned();

assert_eq!(name, owned);

impl<'n> ScopedName<&'n Name>[src]

pub const fn core(name: &'n Name) -> Self[src]

Creates a new instance in the core namespace.

pub const fn ocean(name: &'n Name) -> Self[src]

Creates a new instance in the ocean namespace.

pub fn from_pair<S: ?Sized, N: ?Sized>(
    scope: &'n S,
    name: &'n N
) -> Result<Self, ParseError<ValidateError>> where
    S: AsRef<[u8]>,
    N: AsRef<[u8]>, 
[src]

Creates a new instance by verifying scope and name.

pub unsafe fn from_pair_unchecked<S: ?Sized, N: ?Sized>(
    scope: &'n S,
    name: &'n N
) -> Self where
    S: AsRef<[u8]>,
    N: AsRef<[u8]>, 
[src]

Creates a new instance without attempting to verify scope or name.

Trait Implementations

impl<Name: Clone> Clone for ScopedName<Name>[src]

impl<Name: Copy> Copy for ScopedName<Name>[src]

impl<Name: Debug> Debug for ScopedName<Name>[src]

impl<'de> Deserialize<'de> for ScopedName[src]

impl<N: Display> Display for ScopedName<N>[src]

impl<Name: Eq> Eq for ScopedName<Name>[src]

impl<A, B: Into<A>> From<[B; 2]> for ScopedName<A>[src]

impl<N, A, B> From<(A, B)> for ScopedName<N> where
    A: Into<N>,
    B: Into<N>, 
[src]

impl<N, V> From<ScopedName<N>> for Query<N, V>[src]

impl<Name: Hash> Hash for ScopedName<Name>[src]

impl<Name: Ord> Ord for ScopedName<Name>[src]

impl<'_, A: AsRef<str>> PartialEq<&'_ str> for ScopedName<A>[src]

impl<A: AsRef<str>> PartialEq<ScopedName<A>> for str[src]

impl<'_, A: AsRef<str>> PartialEq<ScopedName<A>> for &'_ str[src]

impl<A, B> PartialEq<ScopedName<B>> for ScopedName<A> where
    A: PartialEq<B>, 
[src]

impl<A: AsRef<str>> PartialEq<str> for ScopedName<A>[src]

impl<Name: PartialOrd> PartialOrd<ScopedName<Name>> for ScopedName<Name>[src]

impl<N> Serialize for ScopedName<N> where
    ScopedName<N>: Display
[src]

impl<Name> StructuralEq for ScopedName<Name>[src]

impl<'a, N> TryFrom<&'a str> for ScopedName<N> where
    &'a str: TryInto<N>, 
[src]

type Error = ParseError<<&'a str as TryInto<N>>::Error>

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<Name> RefUnwindSafe for ScopedName<Name> where
    Name: RefUnwindSafe

impl<Name> Send for ScopedName<Name> where
    Name: Send

impl<Name> Sync for ScopedName<Name> where
    Name: Sync

impl<Name> Unpin for ScopedName<Name> where
    Name: Unpin

impl<Name> UnwindSafe for ScopedName<Name> where
    Name: UnwindSafe

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> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> From<T> 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> ToString for T where
    T: Display + ?Sized
[src]

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

type Error = !

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.