pub enum AccessSecrets {
Blind {
id: RepositoryId,
},
Read {
id: RepositoryId,
read_key: SecretKey,
},
Write(WriteSecrets),
}
Expand description
Secrets for access to a repository.
Variants§
Implementations§
Source§impl AccessSecrets
impl AccessSecrets
Sourcepub fn generate_write<R: Rng + CryptoRng>(rng: &mut R) -> Self
pub fn generate_write<R: Rng + CryptoRng>(rng: &mut R) -> Self
Generates random access secrets with write access using the provided RNG.
Sourcepub fn random_write() -> Self
pub fn random_write() -> Self
Generates random access secrets with write access using OsRng.
Sourcepub fn with_mode(&self, mode: AccessMode) -> Self
pub fn with_mode(&self, mode: AccessMode) -> Self
Change the access mode of this secrets to the given mode. If the given mode is higher than self, returns self unchanged.
pub fn access_mode(&self) -> AccessMode
pub fn id(&self) -> &RepositoryId
pub fn can_write(&self) -> bool
pub fn can_read(&self) -> bool
pub fn read_key(&self) -> Option<&SecretKey>
pub fn write_secrets(&self) -> Option<&WriteSecrets>
pub fn into_write_secrets(self) -> Option<WriteSecrets>
Trait Implementations§
Source§impl Clone for AccessSecrets
impl Clone for AccessSecrets
Source§fn clone(&self) -> AccessSecrets
fn clone(&self) -> AccessSecrets
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for AccessSecrets
impl Debug for AccessSecrets
Source§impl<'de> Deserialize<'de> for AccessSecrets
impl<'de> Deserialize<'de> for AccessSecrets
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
Source§fn from(secrets: AccessSecrets) -> Self
fn from(secrets: AccessSecrets) -> Self
Converts to this type from the input type.
Source§impl PartialEq for AccessSecrets
impl PartialEq for AccessSecrets
Source§impl Serialize for AccessSecrets
impl Serialize for AccessSecrets
impl Eq for AccessSecrets
Auto Trait Implementations§
impl Freeze for AccessSecrets
impl RefUnwindSafe for AccessSecrets
impl Send for AccessSecrets
impl Sync for AccessSecrets
impl Unpin for AccessSecrets
impl UnwindSafe for AccessSecrets
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more