pub struct ResourceGrant { /* private fields */ }Expand description
One ordered service grant of a configuration or secret resource.
The containing service collection determines whether this grants a config or secret. Keeping one shared shape avoids inventing differences between the common source/target/ownership options while preserving the short/long syntax decision.
Implementations§
Source§impl ResourceGrant
impl ResourceGrant
Sourcepub fn new(
source: ProtectedString,
syntax: ResourceGrantSyntax,
) -> Result<Self, ModelError>
pub fn new( source: ProtectedString, syntax: ResourceGrantSyntax, ) -> Result<Self, ModelError>
Creates a grant with a non-empty source resource name.
§Errors
Returns ModelError::EmptyValue or ModelError::ContainsNul.
Sourcepub const fn source(&self) -> &ProtectedString
pub const fn source(&self) -> &ProtectedString
Returns the referenced neutral resource name.
Sourcepub const fn syntax(&self) -> ResourceGrantSyntax
pub const fn syntax(&self) -> ResourceGrantSyntax
Returns the authored short/long syntax family.
Sourcepub fn set_target(&mut self, target: Sourced<ProtectedString>)
pub fn set_target(&mut self, target: Sourced<ProtectedString>)
Sets the requested container path or environment-variable name.
Sourcepub const fn target(&self) -> Option<&Sourced<ProtectedString>>
pub const fn target(&self) -> Option<&Sourced<ProtectedString>>
Returns the explicitly authored target.
Sourcepub fn set_uid(&mut self, uid: Sourced<ProtectedString>)
pub fn set_uid(&mut self, uid: Sourced<ProtectedString>)
Sets the requested container user-ID spelling.
Sourcepub const fn uid(&self) -> Option<&Sourced<ProtectedString>>
pub const fn uid(&self) -> Option<&Sourced<ProtectedString>>
Returns the explicitly authored user-ID spelling.
Sourcepub fn set_gid(&mut self, gid: Sourced<ProtectedString>)
pub fn set_gid(&mut self, gid: Sourced<ProtectedString>)
Sets the requested container group-ID spelling.
Sourcepub const fn gid(&self) -> Option<&Sourced<ProtectedString>>
pub const fn gid(&self) -> Option<&Sourced<ProtectedString>>
Returns the explicitly authored group-ID spelling.
Sourcepub fn set_mode(&mut self, mode: Sourced<ProtectedString>)
pub fn set_mode(&mut self, mode: Sourced<ProtectedString>)
Sets the requested permission-mode spelling.
Sourcepub const fn mode(&self) -> Option<&Sourced<ProtectedString>>
pub const fn mode(&self) -> Option<&Sourced<ProtectedString>>
Returns the explicitly authored permission-mode spelling.
Trait Implementations§
Source§impl Clone for ResourceGrant
impl Clone for ResourceGrant
Source§fn clone(&self) -> ResourceGrant
fn clone(&self) -> ResourceGrant
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more