[−][src]Struct oceanpkg::drop::name::scoped::ScopedName
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]
A: Into<N>,
B: Into<N>,
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]
A: TryInto<Self, Error = ParseError<NE>>,
Attempts to create a new instance by parsing name
.
pub fn cast<A>(self) -> ScopedName<A> where
N: Into<A>,
[src]
N: Into<A>,
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]
N: TryInto<A>,
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]
N: AsRef<A>,
A: ?Sized,
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]
N: AsMut<A>,
A: ?Sized,
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]
F: FnMut(N) -> A,
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]
N: Clone,
Returns the result of calling Clone::clone
on the fields of self
.
pub fn to_owned(&self) -> ScopedName<N::Owned> where
N: ToOwned,
[src]
N: ToOwned,
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]
scope: &'n S,
name: &'n N
) -> Result<Self, ParseError<ValidateError>> where
S: AsRef<[u8]>,
N: AsRef<[u8]>,
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]
scope: &'n S,
name: &'n N
) -> Self where
S: AsRef<[u8]>,
N: AsRef<[u8]>,
Creates a new instance without attempting to verify scope
or name
.
Trait Implementations
impl<Name: Clone> Clone for ScopedName<Name>
[src]
fn clone(&self) -> ScopedName<Name>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<Name: Copy> Copy for ScopedName<Name>
[src]
impl<Name: Debug> Debug for ScopedName<Name>
[src]
impl<'de> Deserialize<'de> for ScopedName
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
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]
A: Into<N>,
B: Into<N>,
impl<N, V> From<ScopedName<N>> for Query<N, V>
[src]
fn from(n: ScopedName<N>) -> Self
[src]
impl<Name: Hash> Hash for ScopedName<Name>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<Name: Ord> Ord for ScopedName<Name>
[src]
fn cmp(&self, other: &ScopedName<Name>) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[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]
A: PartialEq<B>,
fn eq(&self, other: &ScopedName<B>) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<A: AsRef<str>> PartialEq<str> for ScopedName<A>
[src]
impl<Name: PartialOrd> PartialOrd<ScopedName<Name>> for ScopedName<Name>
[src]
fn partial_cmp(&self, other: &ScopedName<Name>) -> Option<Ordering>
[src]
fn lt(&self, other: &ScopedName<Name>) -> bool
[src]
fn le(&self, other: &ScopedName<Name>) -> bool
[src]
fn gt(&self, other: &ScopedName<Name>) -> bool
[src]
fn ge(&self, other: &ScopedName<Name>) -> bool
[src]
impl<N> Serialize for ScopedName<N> where
ScopedName<N>: Display,
[src]
ScopedName<N>: Display,
impl<Name> StructuralEq for ScopedName<Name>
[src]
impl<'a, N> TryFrom<&'a str> for ScopedName<N> where
&'a str: TryInto<N>,
[src]
&'a str: TryInto<N>,
Auto Trait Implementations
impl<Name> RefUnwindSafe for ScopedName<Name> where
Name: RefUnwindSafe,
Name: RefUnwindSafe,
impl<Name> Send for ScopedName<Name> where
Name: Send,
Name: Send,
impl<Name> Sync for ScopedName<Name> where
Name: Sync,
Name: Sync,
impl<Name> Unpin for ScopedName<Name> where
Name: Unpin,
Name: Unpin,
impl<Name> UnwindSafe for ScopedName<Name> where
Name: UnwindSafe,
Name: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,