Enum bonsaidb::core::permissions::Identifier
pub enum Identifier<'a> {
Any,
Integer(u64),
String(Cow<'a, str>),
Bytes(Cow<'a, [u8]>),
}
Expand description
A single element of a ResourceName
Variants§
Any
When checking for allowed permissions, allow any match where this identifier is used.
Integer(u64)
An integer identifier.
String(Cow<'a, str>)
A string identifier.
Bytes(Cow<'a, [u8]>)
A binary identifier.
Implementations§
§impl<'a> Identifier<'a>
impl<'a> Identifier<'a>
pub fn to_owned(&self) -> Identifier<'static>
pub fn to_owned(&self) -> Identifier<'static>
Convert this identifier to an un-borrowed identifier.
Trait Implementations§
§impl<'a> Clone for Identifier<'a>
impl<'a> Clone for Identifier<'a>
§fn clone(&self) -> Identifier<'a>
fn clone(&self) -> Identifier<'a>
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 more§impl<'a> Debug for Identifier<'a>
impl<'a> Debug for Identifier<'a>
§impl<'de, 'a> Deserialize<'de> for Identifier<'a>
impl<'de, 'a> Deserialize<'de> for Identifier<'a>
§fn deserialize<__D>(
__deserializer: __D
) -> Result<Identifier<'a>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<Identifier<'a>, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl<'a> Display for Identifier<'a>
impl<'a> Display for Identifier<'a>
§impl<'a> From<&'a [u8]> for Identifier<'a>
impl<'a> From<&'a [u8]> for Identifier<'a>
§fn from(id: &'a [u8]) -> Identifier<'a>
fn from(id: &'a [u8]) -> Identifier<'a>
Converts to this type from the input type.
§impl<'a, const N: usize> From<&'a [u8; N]> for Identifier<'a>
impl<'a, const N: usize> From<&'a [u8; N]> for Identifier<'a>
§fn from(id: &'a [u8; N]) -> Identifier<'a>
fn from(id: &'a [u8; N]) -> Identifier<'a>
Converts to this type from the input type.
§impl<'a> From<&'a DocumentId> for Identifier<'a>
impl<'a> From<&'a DocumentId> for Identifier<'a>
§fn from(id: &'a DocumentId) -> Identifier<'a>
fn from(id: &'a DocumentId) -> Identifier<'a>
Converts to this type from the input type.
§impl<'a> From<&'a String> for Identifier<'a>
impl<'a> From<&'a String> for Identifier<'a>
§fn from(id: &'a String) -> Identifier<'a>
fn from(id: &'a String) -> Identifier<'a>
Converts to this type from the input type.
§impl<'a> From<&'a str> for Identifier<'a>
impl<'a> From<&'a str> for Identifier<'a>
§fn from(id: &'a str) -> Identifier<'a>
fn from(id: &'a str) -> Identifier<'a>
Converts to this type from the input type.
§impl<'a, const N: usize> From<[u8; N]> for Identifier<'a>
impl<'a, const N: usize> From<[u8; N]> for Identifier<'a>
§fn from(id: [u8; N]) -> Identifier<'a>
fn from(id: [u8; N]) -> Identifier<'a>
Converts to this type from the input type.
§impl<'a> From<DocumentId> for Identifier<'a>
impl<'a> From<DocumentId> for Identifier<'a>
§fn from(id: DocumentId) -> Identifier<'a>
fn from(id: DocumentId) -> Identifier<'a>
Converts to this type from the input type.
§impl<'a> From<String> for Identifier<'a>
impl<'a> From<String> for Identifier<'a>
§fn from(id: String) -> Identifier<'a>
fn from(id: String) -> Identifier<'a>
Converts to this type from the input type.
§impl<'a> From<u64> for Identifier<'a>
impl<'a> From<u64> for Identifier<'a>
§fn from(id: u64) -> Identifier<'a>
fn from(id: u64) -> Identifier<'a>
Converts to this type from the input type.
§impl<'a> Hash for Identifier<'a>
impl<'a> Hash for Identifier<'a>
§impl<'a> PartialEq<Identifier<'a>> for Identifier<'a>
impl<'a> PartialEq<Identifier<'a>> for Identifier<'a>
§fn eq(&self, other: &Identifier<'a>) -> bool
fn eq(&self, other: &Identifier<'a>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.§impl<'a> Serialize for Identifier<'a>
impl<'a> Serialize for Identifier<'a>
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<'a> Eq for Identifier<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for Identifier<'a>
impl<'a> Send for Identifier<'a>
impl<'a> Sync for Identifier<'a>
impl<'a> Unpin for Identifier<'a>
impl<'a> UnwindSafe for Identifier<'a>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§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 Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.