pub struct MacAddress { /* private fields */ }
Expand description

Contains the individual bytes of the MAC address.

Implementationsยง

ยง

impl MacAddress

pub fn new(bytes: [u8; 6]) -> MacAddress

Creates a new MacAddress struct from the given bytes.

ยง

impl MacAddress

pub fn bytes(self) -> [u8; 6]

Returns the array of MAC address bytes.

Trait Implementationsยง

ยง

impl Clone for MacAddress

ยง

fn clone(&self) -> MacAddress

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
ยง

impl Debug for MacAddress

ยง

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

Formats the value using the given formatter. Read more
sourceยง

impl Decode<'_, Postgres> for MacAddress

sourceยง

fn decode( value: PgValueRef<'_> ) -> Result<MacAddress, Box<dyn Error + Sync + Send + 'static, Global>>

Decode a new value of this type using a raw value from the database.
ยง

impl Default for MacAddress

ยง

fn default() -> MacAddress

Returns the โ€œdefault valueโ€ for a type. Read more
ยง

impl Display for MacAddress

ยง

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

Formats the value using the given formatter. Read more
sourceยง

impl Encode<'_, Postgres> for MacAddress

sourceยง

fn encode_by_ref(&self, buf: &mut PgArgumentBuffer) -> IsNull

Writes the value of self into buf without moving self. Read more
sourceยง

fn size_hint(&self) -> usize

sourceยง

fn encode(self, buf: &mut <DB as HasArguments<'q>>::ArgumentBuffer) -> IsNullwhere Self: Sized,

Writes the value of self into buf in the expected format for the database.
sourceยง

fn produces(&self) -> Option<<DB as Database>::TypeInfo>

ยง

impl From<[u8; 6]> for MacAddress

ยง

fn from(v: [u8; 6]) -> MacAddress

Converts to this type from the input type.
ยง

impl FromStr for MacAddress

ยง

type Err = MacParseError

The associated error which can be returned from parsing.
ยง

fn from_str(input: &str) -> Result<MacAddress, <MacAddress as FromStr>::Err>

Parses a string s to return a value of this type. Read more
ยง

impl Hash for MacAddress

ยง

fn hash<__H>(&self, state: &mut __H)where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 ยท sourceยง

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
ยง

impl Ord for MacAddress

ยง

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

This method returns an Ordering between self and other. Read more
1.21.0 ยท sourceยง

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

Compares and returns the maximum of two values. Read more
1.21.0 ยท sourceยง

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

Compares and returns the minimum of two values. Read more
1.50.0 ยท sourceยง

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

Restrict a value to a certain interval. Read more
ยง

impl PartialEq<MacAddress> for MacAddress

ยง

fn eq(&self, other: &MacAddress) -> 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.
ยง

impl PartialOrd<MacAddress> for MacAddress

ยง

fn partial_cmp(&self, other: &MacAddress) -> 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 PgHasArrayType for MacAddress

ยง

impl TryFrom<&str> for MacAddress

ยง

type Error = MacParseError

The type returned in the event of a conversion error.
ยง

fn try_from( value: &str ) -> Result<MacAddress, <MacAddress as TryFrom<&str>>::Error>

Performs the conversion.
ยง

impl TryFrom<Cow<'_, str>> for MacAddress

ยง

type Error = MacParseError

The type returned in the event of a conversion error.
ยง

fn try_from( value: Cow<'_, str> ) -> Result<MacAddress, <MacAddress as TryFrom<Cow<'_, str>>>::Error>

Performs the conversion.
sourceยง

impl Type<Postgres> for MacAddress

sourceยง

fn type_info() -> PgTypeInfo

Returns the canonical SQL type for this Rust type. Read more
sourceยง

fn compatible(ty: &PgTypeInfo) -> bool

Determines if this Rust type is compatible with the given SQL type. Read more
ยง

impl Copy for MacAddress

ยง

impl Eq for MacAddress

ยง

impl StructuralEq for MacAddress

ยง

impl StructuralPartialEq for MacAddress

Auto Trait Implementationsยง

Blanket Implementationsยง

sourceยง

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

sourceยง

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
sourceยง

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

const: unstable ยท sourceยง

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
sourceยง

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

const: unstable ยท sourceยง

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

Mutably borrows from an owned value. Read more
ยง

impl<T> CallHasher for Twhere T: Hash + ?Sized,

ยง

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64where H: Hash + ?Sized, B: BuildHasher,

sourceยง

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

sourceยง

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
sourceยง

impl<T> From<T> for T

const: unstable ยท sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

sourceยง

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

const: unstable ยท 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> Same<T> for T

ยง

type Output = T

Should always be Self
sourceยง

impl<T> ToOwned for Twhere 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> ToString for Twhere T: Display + ?Sized,

sourceยง

default fn to_string(&self) -> String

Converts the given value to a String. Read more
sourceยง

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

ยง

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable ยท sourceยง

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

Performs the conversion.
sourceยง

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

ยง

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

The type returned in the event of a conversion error.
const: unstable ยท sourceยง

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

Performs the conversion.
ยง

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

ยง

fn vzip(self) -> V