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) -> KeyStringwhere
Self: Debug,
pub fn expect_key_string(self) -> KeyStringwhere
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) -> ObjectIdentifierwhere
Self: Debug,
pub fn expect_oid(self) -> ObjectIdentifierwhere
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
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl 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>,
sourceimpl Display for KeyStringOrOID
impl Display for KeyStringOrOID
sourceimpl From<&KeyString> for KeyStringOrOID
impl From<&KeyString> for KeyStringOrOID
sourceimpl From<&KeyStringOrOID> for KeyStringOrOID
impl From<&KeyStringOrOID> for KeyStringOrOID
sourcefn from(value: &KeyStringOrOID) -> Self
fn from(value: &KeyStringOrOID) -> Self
sourceimpl From<&ObjectIdentifier> for KeyStringOrOID
impl From<&ObjectIdentifier> for KeyStringOrOID
sourcefn from(value: &ObjectIdentifier) -> Self
fn from(value: &ObjectIdentifier) -> Self
sourceimpl From<KeyString> for KeyStringOrOID
impl From<KeyString> for KeyStringOrOID
sourceimpl From<ObjectIdentifier> for KeyStringOrOID
impl From<ObjectIdentifier> for KeyStringOrOID
sourcefn from(value: ObjectIdentifier) -> Self
fn from(value: ObjectIdentifier) -> Self
sourceimpl FromStr for KeyStringOrOID
impl FromStr for KeyStringOrOID
sourceimpl Hash for KeyStringOrOID
impl Hash for KeyStringOrOID
sourceimpl Ord for KeyStringOrOID
impl Ord for KeyStringOrOID
1.21.0 · sourceconst fn max(self, other: Self) -> Self
const fn max(self, other: Self) -> Self
1.21.0 · sourceconst fn min(self, other: Self) -> Self
const fn min(self, other: Self) -> Self
1.50.0 · sourceconst fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
const fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
sourceimpl PartialEq<KeyStringOrOID> for KeyStringOrOID
impl PartialEq<KeyStringOrOID> for KeyStringOrOID
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>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more