#[repr(C)]pub struct ScopedName<Name = String> {
pub scope: Name,
pub name: Name,
}Expand description
Name in the format <owner>/<drop>.
Fields§
§scope: NameThe namespace of the drop.
name: NameThe drop’s given name.
Implementations§
Source§impl<N> ScopedName<N>
impl<N> ScopedName<N>
Sourcepub fn parse<A, NE>(name: A) -> Result<Self, ParseError<NE>>where
A: TryInto<Self, Error = ParseError<NE>>,
pub fn parse<A, NE>(name: A) -> Result<Self, ParseError<NE>>where
A: TryInto<Self, Error = ParseError<NE>>,
Attempts to create a new instance by parsing name.
Sourcepub fn cast<A>(self) -> ScopedName<A>where
N: Into<A>,
pub fn cast<A>(self) -> ScopedName<A>where
N: Into<A>,
Converts self into a new ScopedName by performing an Into
conversion over all fields.
Sourcepub fn try_cast<A>(self) -> Result<ScopedName<A>, ParseError<N::Error>>where
N: TryInto<A>,
pub fn try_cast<A>(self) -> Result<ScopedName<A>, ParseError<N::Error>>where
N: TryInto<A>,
Converts self into a new Query by performing an Into conversion
over all fields.
Sourcepub fn as_ref(&self) -> ScopedName<&N>
pub fn as_ref(&self) -> ScopedName<&N>
Takes shared references to the fields of this name.
Sourcepub fn to_ref<A>(&self) -> ScopedName<&A>
pub fn to_ref<A>(&self) -> ScopedName<&A>
Takes a shared reference to the fields of this name as type A.
Sourcepub fn as_mut(&mut self) -> ScopedName<&mut N>
pub fn as_mut(&mut self) -> ScopedName<&mut N>
Takes mutable references to the fields of this name.
Sourcepub fn to_mut<A>(&mut self) -> ScopedName<&mut A>
pub fn to_mut<A>(&mut self) -> ScopedName<&mut A>
Takes a mutable references to the fields of this name as type A.
Sourcepub fn map<A, F>(self, f: F) -> ScopedName<A>where
F: FnMut(N) -> A,
pub fn map<A, F>(self, f: F) -> ScopedName<A>where
F: FnMut(N) -> A,
Creates a new ScopedName by mapping the function over the fields of
self.
Sourcepub fn into_query(self) -> Query<N>
pub fn into_query(self) -> Query<N>
Converts self into a Query.
Sourcepub fn into_query_with<V>(self, version: V) -> Query<N, V>
pub fn into_query_with<V>(self, version: V) -> Query<N, V>
Converts self into a Query with the specified version.
Sourcepub fn as_names_array(&self) -> &[N; 2]
pub fn as_names_array(&self) -> &[N; 2]
Converts self into an array of names.
Sourcepub fn as_names_slice(&self) -> &[N]
pub fn as_names_slice(&self) -> &[N]
Converts self into a slice of names.
Source§impl<'n, N: ?Sized> ScopedName<&'n N>
impl<'n, N: ?Sized> ScopedName<&'n N>
Sourcepub fn cloned(&self) -> ScopedName<N>where
N: Clone,
pub fn cloned(&self) -> ScopedName<N>where
N: Clone,
Returns the result of calling Clone::clone on the fields of self.
Sourcepub fn to_owned(&self) -> ScopedName<N::Owned>where
N: ToOwned,
pub fn to_owned(&self) -> ScopedName<N::Owned>where
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);Source§impl<'n> ScopedName<&'n Name>
impl<'n> ScopedName<&'n Name>
Sourcepub fn from_pair<S, N>(
scope: &'n S,
name: &'n N,
) -> Result<Self, ParseError<ValidateError>>
pub fn from_pair<S, N>( scope: &'n S, name: &'n N, ) -> Result<Self, ParseError<ValidateError>>
Creates a new instance by verifying scope and name.
Trait Implementations§
Source§impl<Name: Clone> Clone for ScopedName<Name>
impl<Name: Clone> Clone for ScopedName<Name>
Source§fn clone(&self) -> ScopedName<Name>
fn clone(&self) -> ScopedName<Name>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more