[][src]Struct oceanpkg::drop::name::query::QueryName

#[repr(C)]
pub struct QueryName<'a> {
    pub scope: Option<&'a Name>,
    pub name: &'a Name,
}

A drop name that may or may not be scoped.

Fields

scope: Option<&'a Name>

The scope scope if the query is scoped to a specific owner.

If this scope is None, then drops are checked against the main trusted set of packages. It is not yet decided as to what goes there.

name: &'a Name

The name of the drop itself.

Methods

impl<'a> QueryName<'a>[src]

pub fn new<S, N>(scope: S, name: N) -> Self where
    S: Into<Option<&'a Name>>,
    N: Into<&'a Name>, 
[src]

Creates a new instance from scope and name.

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

Attempts to create a new instance by parsing query.

pub fn into_owned(self) -> OwnedQueryName[src]

Copies the data referred to by self and takes ownership of it.

pub fn to_scoped(&self) -> Option<&ScopedName<'a>>[src]

Converts self to a scoped name if it is one.

pub fn to_name(&self) -> Option<&'a Name>[src]

Converts self to a simple name if it has no scope.

pub fn as_names(&self) -> &[&'a Name][src]

Converts self into a slice of Names.

Trait Implementations

impl<'a> AsRef<QueryName<'a>> for ScopedName<'a>[src]

impl<'a> From<&'a Name> for QueryName<'a>[src]

impl<'a, N: Into<&'a Name>> From<[N; 2]> for QueryName<'a>[src]

impl<'a, S, N> From<(S, N)> for QueryName<'a> where
    S: Into<Option<&'a Name>>,
    N: Into<&'a Name>, 
[src]

impl<'a> From<ScopedName<'a>> for QueryName<'a>[src]

impl<'_> From<QueryName<'_>> for OwnedQueryName[src]

impl<'a> Clone for QueryName<'a>[src]

impl<'a> Copy for QueryName<'a>[src]

impl<'a> Eq for QueryName<'a>[src]

impl<'a> Ord for QueryName<'a>[src]

impl<'a> PartialEq<QueryName<'a>> for QueryName<'a>[src]

impl<'_> PartialEq<Name> for QueryName<'_>[src]

impl<'_, '_> PartialEq<&'_ Name> for QueryName<'_>[src]

impl<'_> PartialEq<QueryName<'_>> for Name[src]

impl<'_, '_> PartialEq<QueryName<'_>> for &'_ Name[src]

impl<'_> PartialEq<str> for QueryName<'_>[src]

impl<'_, '_> PartialEq<&'_ str> for QueryName<'_>[src]

impl<'_> PartialEq<QueryName<'_>> for str[src]

impl<'_, '_> PartialEq<QueryName<'_>> for &'_ str[src]

impl<'a> PartialOrd<QueryName<'a>> for QueryName<'a>[src]

impl<'a> Debug for QueryName<'a>[src]

impl<'_> Display for QueryName<'_>[src]

impl<'a> TryFrom<&'a str> for QueryName<'a>[src]

type Error = ParseError

The type returned in the event of a conversion error.

impl<'a> TryFrom<&'a [u8]> for QueryName<'a>[src]

type Error = ParseError

The type returned in the event of a conversion error.

impl<'a> TryFrom<&'a OsStr> for QueryName<'a>[src]

type Error = ParseError

The type returned in the event of a conversion error.

impl<'a> Hash for QueryName<'a>[src]

impl<'a> StructuralPartialEq for QueryName<'a>[src]

impl<'a> StructuralEq for QueryName<'a>[src]

impl<'_> Serialize for QueryName<'_>[src]

impl<'de: 'a, 'a> Deserialize<'de> for QueryName<'a>[src]

Auto Trait Implementations

impl<'a> Send for QueryName<'a>

impl<'a> Sync for QueryName<'a>

impl<'a> Unpin for QueryName<'a>

impl<'a> UnwindSafe for QueryName<'a>

impl<'a> RefUnwindSafe for QueryName<'a>

Blanket Implementations

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.

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

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

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

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]