Struct mmdb::basic::orphan::Orphan

source ·
pub struct Orphan<T> { /* private fields */ }
Expand description

Used to express some ‘non-collection’ types, such as any type of integer, an enum value, etc..

Implementations§

source§

impl<T> Orphan<T>
where T: ValueEnDe,

source

pub unsafe fn shadow(&self) -> Self

§Safety

This API breaks the semantic safety guarantees, but it is safe to use in a race-free environment.

source

pub unsafe fn from_bytes(s: impl AsRef<[u8]>) -> Self

§Safety

Do not use this API unless you know the internal details extremely well.

source

pub fn as_bytes(&self) -> &[u8]

source

pub fn new(v: T) -> Self

source

pub fn get_value(&self) -> T

Get the inner cloned value.

source

pub fn set_value(&mut self, v: &T)

source

pub fn is_uninitialized(&self) -> bool

source

pub fn initialize_if_empty(&mut self, v: T)

source

pub fn get_mut(&mut self) -> ValueMut<'_, T>

Get the mutable handler of the value.

NOTE:

  • Always use this method to change value
    • *(<Orphan>).get_mut() = ...
  • NEVER do this:
    • *(&mut <Orphan>) = Orphan::new(...)

Trait Implementations§

source§

impl<T> Add<T> for Orphan<T>
where T: ValueEnDe + Ord + Eq + Add<Output = T>,

§

type Output = T

The resulting type after applying the + operator.
source§

fn add(self, other: T) -> Self::Output

Performs the + operation. Read more
source§

impl<T> Add for Orphan<T>
where T: ValueEnDe + Ord + Eq + Add<Output = T>,

§

type Output = T

The resulting type after applying the + operator.
source§

fn add(self, other: Self) -> Self::Output

Performs the + operation. Read more
source§

impl<T> AddAssign<T> for Orphan<T>
where T: ValueEnDe + Ord + Eq + AddAssign,

source§

fn add_assign(&mut self, other: T)

Performs the += operation. Read more
source§

impl<T> AddAssign for Orphan<T>
where T: ValueEnDe + Ord + Eq + AddAssign,

source§

fn add_assign(&mut self, other: Self)

Performs the += operation. Read more
source§

impl<T> BitAnd<T> for Orphan<T>
where T: ValueEnDe + Ord + Eq + BitAnd<Output = T>,

§

type Output = T

The resulting type after applying the & operator.
source§

fn bitand(self, other: T) -> Self::Output

Performs the & operation. Read more
source§

impl<T> BitAnd for Orphan<T>
where T: ValueEnDe + Ord + Eq + BitAnd<Output = T>,

§

type Output = T

The resulting type after applying the & operator.
source§

fn bitand(self, other: Self) -> Self::Output

Performs the & operation. Read more
source§

impl<T> BitAndAssign<T> for Orphan<T>
where T: ValueEnDe + Ord + Eq + BitAndAssign,

source§

fn bitand_assign(&mut self, other: T)

Performs the &= operation. Read more
source§

impl<T> BitAndAssign for Orphan<T>
where T: ValueEnDe + Ord + Eq + BitAndAssign,

source§

fn bitand_assign(&mut self, other: Self)

Performs the &= operation. Read more
source§

impl<T> BitOr<T> for Orphan<T>
where T: ValueEnDe + Ord + Eq + BitOr<Output = T>,

§

type Output = T

The resulting type after applying the | operator.
source§

fn bitor(self, other: T) -> Self::Output

Performs the | operation. Read more
source§

impl<T> BitOr for Orphan<T>
where T: ValueEnDe + Ord + Eq + BitOr<Output = T>,

§

type Output = T

The resulting type after applying the | operator.
source§

fn bitor(self, other: Self) -> Self::Output

Performs the | operation. Read more
source§

impl<T> BitOrAssign<T> for Orphan<T>
where T: ValueEnDe + Ord + Eq + BitOrAssign,

source§

fn bitor_assign(&mut self, other: T)

Performs the |= operation. Read more
source§

impl<T> BitOrAssign for Orphan<T>
where T: ValueEnDe + Ord + Eq + BitOrAssign,

source§

fn bitor_assign(&mut self, other: Self)

Performs the |= operation. Read more
source§

impl<T> BitXor<T> for Orphan<T>
where T: ValueEnDe + Ord + Eq + BitXor<Output = T>,

§

type Output = T

The resulting type after applying the ^ operator.
source§

fn bitxor(self, other: T) -> Self::Output

Performs the ^ operation. Read more
source§

impl<T> BitXor for Orphan<T>
where T: ValueEnDe + Ord + Eq + BitXor<Output = T>,

§

type Output = T

The resulting type after applying the ^ operator.
source§

fn bitxor(self, other: Self) -> Self::Output

Performs the ^ operation. Read more
source§

impl<T> BitXorAssign<T> for Orphan<T>
where T: ValueEnDe + Ord + Eq + BitXorAssign,

source§

fn bitxor_assign(&mut self, other: T)

Performs the ^= operation. Read more
source§

impl<T> BitXorAssign for Orphan<T>
where T: ValueEnDe + Ord + Eq + BitXorAssign,

source§

fn bitxor_assign(&mut self, other: Self)

Performs the ^= operation. Read more
source§

impl<T> Clone for Orphan<T>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug> Debug for Orphan<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: Default + ValueEnDe> Default for Orphan<T>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de, T> Deserialize<'de> for Orphan<T>

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<T> Div<T> for Orphan<T>
where T: ValueEnDe + Ord + Eq + Div<Output = T>,

§

type Output = T

The resulting type after applying the / operator.
source§

fn div(self, other: T) -> Self::Output

Performs the / operation. Read more
source§

impl<T> Div for Orphan<T>
where T: ValueEnDe + Ord + Eq + Div<Output = T>,

§

type Output = T

The resulting type after applying the / operator.
source§

fn div(self, other: Self) -> Self::Output

Performs the / operation. Read more
source§

impl<T> DivAssign<T> for Orphan<T>
where T: ValueEnDe + Ord + Eq + DivAssign,

source§

fn div_assign(&mut self, other: T)

Performs the /= operation. Read more
source§

impl<T> DivAssign for Orphan<T>
where T: ValueEnDe + Ord + Eq + DivAssign,

source§

fn div_assign(&mut self, other: Self)

Performs the /= operation. Read more
source§

impl<T> Mul<T> for Orphan<T>
where T: ValueEnDe + Ord + Eq + Mul<Output = T>,

§

type Output = T

The resulting type after applying the * operator.
source§

fn mul(self, other: T) -> Self::Output

Performs the * operation. Read more
source§

impl<T> Mul for Orphan<T>
where T: ValueEnDe + Ord + Eq + Mul<Output = T>,

§

type Output = T

The resulting type after applying the * operator.
source§

fn mul(self, other: Self) -> Self::Output

Performs the * operation. Read more
source§

impl<T> MulAssign<T> for Orphan<T>
where T: ValueEnDe + Ord + Eq + MulAssign,

source§

fn mul_assign(&mut self, other: T)

Performs the *= operation. Read more
source§

impl<T> MulAssign for Orphan<T>
where T: ValueEnDe + Ord + Eq + MulAssign,

source§

fn mul_assign(&mut self, other: Self)

Performs the *= operation. Read more
source§

impl<T> Neg for Orphan<T>
where T: ValueEnDe + Ord + Eq + Neg<Output = T>,

§

type Output = T

The resulting type after applying the - operator.
source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
source§

impl<T> Not for Orphan<T>
where T: ValueEnDe + Ord + Eq + Not<Output = T>,

§

type Output = T

The resulting type after applying the ! operator.
source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
source§

impl<T> Ord for Orphan<T>
where T: ValueEnDe + Ord,

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl<T> PartialEq<T> for Orphan<T>
where T: ValueEnDe + PartialEq,

source§

fn eq(&self, other: &T) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialEq for Orphan<T>
where T: ValueEnDe + PartialEq,

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialOrd<T> for Orphan<T>
where T: ValueEnDe + Ord,

source§

fn partial_cmp(&self, other: &T) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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 · source§

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
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<T> PartialOrd for Orphan<T>
where T: ValueEnDe + Ord,

source§

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 · source§

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 · source§

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
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<T> Rem<T> for Orphan<T>
where T: ValueEnDe + Ord + Eq + Rem<Output = T>,

§

type Output = T

The resulting type after applying the % operator.
source§

fn rem(self, other: T) -> Self::Output

Performs the % operation. Read more
source§

impl<T> Rem for Orphan<T>
where T: ValueEnDe + Ord + Eq + Rem<Output = T>,

§

type Output = T

The resulting type after applying the % operator.
source§

fn rem(self, other: Self) -> Self::Output

Performs the % operation. Read more
source§

impl<T> RemAssign<T> for Orphan<T>
where T: ValueEnDe + Ord + Eq + RemAssign,

source§

fn rem_assign(&mut self, other: T)

Performs the %= operation. Read more
source§

impl<T> RemAssign for Orphan<T>
where T: ValueEnDe + Ord + Eq + RemAssign,

source§

fn rem_assign(&mut self, other: Self)

Performs the %= operation. Read more
source§

impl<T> Serialize for Orphan<T>

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<T> Shl<T> for Orphan<T>
where T: ValueEnDe + Ord + Eq + Shl<Output = T>,

§

type Output = T

The resulting type after applying the << operator.
source§

fn shl(self, other: T) -> Self::Output

Performs the << operation. Read more
source§

impl<T> Shl for Orphan<T>
where T: ValueEnDe + Ord + Eq + Shl<Output = T>,

§

type Output = T

The resulting type after applying the << operator.
source§

fn shl(self, other: Self) -> Self::Output

Performs the << operation. Read more
source§

impl<T> ShlAssign<T> for Orphan<T>
where T: ValueEnDe + Ord + Eq + ShlAssign,

source§

fn shl_assign(&mut self, other: T)

Performs the <<= operation. Read more
source§

impl<T> ShlAssign for Orphan<T>
where T: ValueEnDe + Ord + Eq + ShlAssign,

source§

fn shl_assign(&mut self, other: Self)

Performs the <<= operation. Read more
source§

impl<T> Shr<T> for Orphan<T>
where T: ValueEnDe + Ord + Eq + Shr<Output = T>,

§

type Output = T

The resulting type after applying the >> operator.
source§

fn shr(self, other: T) -> Self::Output

Performs the >> operation. Read more
source§

impl<T> Shr for Orphan<T>
where T: ValueEnDe + Ord + Eq + Shr<Output = T>,

§

type Output = T

The resulting type after applying the >> operator.
source§

fn shr(self, other: Self) -> Self::Output

Performs the >> operation. Read more
source§

impl<T> ShrAssign<T> for Orphan<T>
where T: ValueEnDe + Ord + Eq + ShrAssign,

source§

fn shr_assign(&mut self, other: T)

Performs the >>= operation. Read more
source§

impl<T> ShrAssign for Orphan<T>
where T: ValueEnDe + Ord + Eq + ShrAssign,

source§

fn shr_assign(&mut self, other: Self)

Performs the >>= operation. Read more
source§

impl<T> Sub<T> for Orphan<T>
where T: ValueEnDe + Ord + Eq + Sub<Output = T>,

§

type Output = T

The resulting type after applying the - operator.
source§

fn sub(self, other: T) -> Self::Output

Performs the - operation. Read more
source§

impl<T> Sub for Orphan<T>
where T: ValueEnDe + Ord + Eq + Sub<Output = T>,

§

type Output = T

The resulting type after applying the - operator.
source§

fn sub(self, other: Self) -> Self::Output

Performs the - operation. Read more
source§

impl<T> SubAssign<T> for Orphan<T>
where T: ValueEnDe + Ord + Eq + SubAssign,

source§

fn sub_assign(&mut self, other: T)

Performs the -= operation. Read more
source§

impl<T> SubAssign for Orphan<T>
where T: ValueEnDe + Ord + Eq + SubAssign,

source§

fn sub_assign(&mut self, other: Self)

Performs the -= operation. Read more
source§

impl<T> Eq for Orphan<T>
where T: ValueEnDe + PartialEq,

Auto Trait Implementations§

§

impl<T> Freeze for Orphan<T>

§

impl<T> RefUnwindSafe for Orphan<T>
where T: RefUnwindSafe,

§

impl<T> Send for Orphan<T>
where T: Send,

§

impl<T> Sync for Orphan<T>
where T: Sync,

§

impl<T> Unpin for Orphan<T>
where T: Unpin,

§

impl<T> UnwindSafe for Orphan<T>
where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> KeyDe for T

source§

fn decode_key(bytes: &[u8]) -> Result<T, Box<dyn RucError>>

Decode from bytes to the original key type.
source§

impl<T> KeyEn for T
where T: Serialize,

source§

fn try_encode_key(&self) -> Result<Vec<u8>, Box<dyn RucError>>

Encode original key type to bytes.
source§

fn encode_key(&self) -> RawBytes

source§

impl<T> KeyEnDe for T
where T: KeyEn + KeyDe,

source§

fn try_encode(&self) -> Result<Vec<u8>, Box<dyn RucError>>

Encode original key type to bytes.
source§

fn encode(&self) -> Vec<u8>

source§

fn decode(bytes: &[u8]) -> Result<T, Box<dyn RucError>>

Decode from bytes to the original key type.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> ValueDe for T

source§

fn decode_value(bytes: &[u8]) -> Result<T, Box<dyn RucError>>

Decode from bytes to the original key type.
source§

impl<T> ValueEn for T
where T: Serialize,

source§

fn try_encode_value(&self) -> Result<Vec<u8>, Box<dyn RucError>>

Encode original key type to bytes.
source§

fn encode_value(&self) -> RawBytes

source§

impl<T> ValueEnDe for T
where T: ValueEn + ValueDe,

source§

fn try_encode(&self) -> Result<Vec<u8>, Box<dyn RucError>>

Encode original key type to bytes.
source§

fn encode(&self) -> Vec<u8>

source§

fn decode(bytes: &[u8]) -> Result<T, Box<dyn RucError>>

Decode from bytes to the original key type.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<T, Rhs> NumAssignOps<Rhs> for T
where T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,

source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,