pub struct FullName { /* private fields */ }Expand description
A full resource name: //, the global host of the service that owns the
resource, / and its relative name.
Built only by FullName::parse (the full form) or
FullName::from_relative (a service and a relative name), both of
which refuse anything but the one canonical spelling, so two names are
equal exactly when they name the same resource. Display, FromStr
and serde use the full form, and only it.
Implementations§
Source§impl FullName
impl FullName
Sourcepub fn parse(name: &str) -> Result<FullName, FullNameError>
pub fn parse(name: &str) -> Result<FullName, FullNameError>
Parses the full form, //{host}/{relative}, and nothing else.
Refused: a URN, a URL (any scheme), a relative name, a bare id, a
host that isn’t the global host of one of RESOURCE_SERVICES (a
regional or zonal one included), an API version as the first
segment, a trailing /, and an empty, ., .. or otherwise
invalid segment.
Sourcepub fn from_relative(
service: &str,
relative: &str,
) -> Result<FullName, FullNameError>
pub fn from_relative( service: &str, relative: &str, ) -> Result<FullName, FullNameError>
The full name of the resource relative (its name) of service,
a short code such as pvs: //{service}.origincloudapis.eu/ +
relative.
Refused: a service that isn’t one of RESOURCE_SERVICES, a full
name given as the relative one, an API version as the first segment,
a trailing /, and an empty, ., .. or otherwise invalid
segment.
Sourcepub fn relative(&self) -> &str
pub fn relative(&self) -> &str
The relative name, the resource’s name: the full name without
//{host}/.
Sourcepub fn url(&self, version: &str) -> Result<String, FullNameError>
pub fn url(&self, version: &str) -> Result<String, FullNameError>
The URL that calls the resource,
https://{host}/{version}/{relative}, for an API version such as
v1beta1.
Sourcepub fn principal(&self) -> Option<Principal<'_>>
pub fn principal(&self) -> Option<Principal<'_>>
The principal the name is, if it is one: a user, a service account, a service agent or an internal platform service, each an iam name.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FullName
A string in the full form; anything FullName::parse refuses is an
error.
impl<'de> Deserialize<'de> for FullName
A string in the full form; anything FullName::parse refuses is an
error.
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
impl Eq for FullName
Source§impl Ord for FullName
impl Ord for FullName
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for FullName
impl PartialOrd for FullName
impl StructuralPartialEq for FullName
Auto Trait Implementations§
impl Forget for FullName
impl Freeze for FullName
impl Move for FullName
impl RefUnwindSafe for FullName
impl Send for FullName
impl Sync for FullName
impl Unpin for FullName
impl UnsafeUnpin for FullName
impl UnwindSafe for FullName
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.