#[non_exhaustive]pub struct Namespace {
pub resource: Resource,
pub owner_id: Option<u64>,
pub kind: NamespaceKind,
pub installation_id: Option<u64>,
}Expand description
A bound namespace, as the adapter needs it (§4.1). The VTC’s record has
more (id, boundBy, boundAt); the adapter needs only what locates the
owner on the forge and the credential that acts on it.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.resource: Resourcehost/owner, e.g. github.com/acme.
owner_id: Option<u64>The forge’s numeric id for the owner — survives renames.
kind: NamespaceKindOrganisation or personal account.
installation_id: Option<u64>The automation credential’s handle on this namespace (a GitHub App
installation id). None is manual mode: the VTC governs rights and
the registry, but nothing acts on the forge.
Implementations§
Source§impl Namespace
impl Namespace
Sourcepub fn new(resource: Resource, kind: NamespaceKind) -> Self
pub fn new(resource: Resource, kind: NamespaceKind) -> Self
A namespace with no owner id and no installation (manual mode).
Sourcepub fn with_owner_id(self, id: u64) -> Self
pub fn with_owner_id(self, id: u64) -> Self
Set the owner’s numeric id.
Sourcepub fn with_installation(self, id: u64) -> Self
pub fn with_installation(self, id: u64) -> Self
Set the installation id.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Namespace
impl<'de> Deserialize<'de> for Namespace
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Namespace
impl StructuralPartialEq for Namespace
Auto Trait Implementations§
impl Freeze for Namespace
impl RefUnwindSafe for Namespace
impl Send for Namespace
impl Sync for Namespace
impl Unpin for Namespace
impl UnsafeUnpin for Namespace
impl UnwindSafe for Namespace
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
Mutably borrows from an owned value. Read more