Enum ldap_types::basic::KeyStringOrOID
source · [−]pub enum KeyStringOrOID {
KeyString(KeyString),
OID(ObjectIdentifier),
}
Expand description
LDAP allows the use of either a keystring or an OID in many locations, e.g. in DNs or in the schema
Variants
KeyString(KeyString)
this represents a KeyString
OID(ObjectIdentifier)
this reprents an ObjectIdentifier
Implementations
sourceimpl KeyStringOrOID
impl KeyStringOrOID
sourcepub fn is_key_string(&self) -> bool
pub fn is_key_string(&self) -> bool
Returns true
if self
is of variant KeyString
.
sourcepub fn expect_key_string(self) -> KeyString where
Self: Debug,
pub fn expect_key_string(self) -> KeyString where
Self: Debug,
sourcepub fn key_string(self) -> Option<KeyString>
pub fn key_string(self) -> Option<KeyString>
Returns Some
if self
is of variant KeyString
, and None
otherwise.
sourcepub fn expect_oid(self) -> ObjectIdentifier where
Self: Debug,
pub fn expect_oid(self) -> ObjectIdentifier where
Self: Debug,
sourcepub fn oid(self) -> Option<ObjectIdentifier>
pub fn oid(self) -> Option<ObjectIdentifier>
Returns Some
if self
is of variant OID
, and None
otherwise.
sourceimpl KeyStringOrOID
impl KeyStringOrOID
sourcepub fn as_key_string_mut(&mut self) -> Option<&mut KeyString>
pub fn as_key_string_mut(&mut self) -> Option<&mut KeyString>
Optionally returns mutable references to the inner fields if this is a KeyStringOrOID::KeyString
, otherwise None
sourcepub fn as_key_string(&self) -> Option<&KeyString>
pub fn as_key_string(&self) -> Option<&KeyString>
Optionally returns references to the inner fields if this is a KeyStringOrOID::KeyString
, otherwise None
sourcepub fn into_key_string(self) -> Result<KeyString, Self>
pub fn into_key_string(self) -> Result<KeyString, Self>
Returns the inner fields if this is a KeyStringOrOID::KeyString
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_oid_mut(&mut self) -> Option<&mut ObjectIdentifier>
pub fn as_oid_mut(&mut self) -> Option<&mut ObjectIdentifier>
Optionally returns mutable references to the inner fields if this is a KeyStringOrOID::OID
, otherwise None
sourcepub fn as_oid(&self) -> Option<&ObjectIdentifier>
pub fn as_oid(&self) -> Option<&ObjectIdentifier>
Optionally returns references to the inner fields if this is a KeyStringOrOID::OID
, otherwise None
sourcepub fn into_oid(self) -> Result<ObjectIdentifier, Self>
pub fn into_oid(self) -> Result<ObjectIdentifier, Self>
Returns the inner fields if this is a KeyStringOrOID::OID
, otherwise returns back the enum in the Err
case of the result
Trait Implementations
sourceimpl Clone for KeyStringOrOID
impl Clone for KeyStringOrOID
sourcefn clone(&self) -> KeyStringOrOID
fn clone(&self) -> KeyStringOrOID
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for KeyStringOrOID
impl Debug for KeyStringOrOID
sourceimpl<'de> Deserialize<'de> for KeyStringOrOID
impl<'de> Deserialize<'de> for KeyStringOrOID
sourcefn 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
sourceimpl Display for KeyStringOrOID
impl Display for KeyStringOrOID
sourceimpl Ord for KeyStringOrOID
impl Ord for KeyStringOrOID
sourceimpl PartialEq<KeyStringOrOID> for KeyStringOrOID
impl PartialEq<KeyStringOrOID> for KeyStringOrOID
sourcefn eq(&self, other: &KeyStringOrOID) -> bool
fn eq(&self, other: &KeyStringOrOID) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &KeyStringOrOID) -> bool
fn ne(&self, other: &KeyStringOrOID) -> bool
This method tests for !=
.
sourceimpl PartialOrd<KeyStringOrOID> for KeyStringOrOID
impl PartialOrd<KeyStringOrOID> for KeyStringOrOID
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl Serialize for KeyStringOrOID
impl Serialize for KeyStringOrOID
impl Eq for KeyStringOrOID
impl StructuralEq for KeyStringOrOID
impl StructuralPartialEq for KeyStringOrOID
Auto Trait Implementations
impl RefUnwindSafe for KeyStringOrOID
impl Send for KeyStringOrOID
impl Sync for KeyStringOrOID
impl Unpin for KeyStringOrOID
impl UnwindSafe for KeyStringOrOID
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more