Struct sqlx::types::mac_address::MacAddress
[−]pub struct MacAddress { /* private fields */ }
Expand description
Contains the individual bytes of the MAC address.
Implementations
impl MacAddress
impl MacAddress
pub fn new(bytes: [u8; 6]) -> MacAddress
pub fn new(bytes: [u8; 6]) -> MacAddress
Creates a new MacAddress
struct from the given bytes.
impl MacAddress
impl MacAddress
Trait Implementations
impl Clone for MacAddress
impl Clone for MacAddress
fn clone(&self) -> MacAddress
fn clone(&self) -> MacAddress
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
impl Debug for MacAddress
impl Debug for MacAddress
sourceimpl<'_> Decode<'_, Postgres> for MacAddress
impl<'_> Decode<'_, Postgres> for MacAddress
sourcefn decode(
value: PgValueRef<'_>
) -> Result<MacAddress, Box<dyn Error + Sync + Send + 'static, Global>>
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
impl Default for MacAddress
fn default() -> MacAddress
fn default() -> MacAddress
Returns the “default value” for a type. Read more
impl Display for MacAddress
impl Display for MacAddress
sourceimpl<'_> Encode<'_, Postgres> for MacAddress
impl<'_> Encode<'_, Postgres> for MacAddress
sourcefn encode_by_ref(&self, buf: &mut PgArgumentBuffer) -> IsNull
fn encode_by_ref(&self, buf: &mut PgArgumentBuffer) -> IsNull
Writes the value of self
into buf
without moving self
. Read more
fn size_hint(&self) -> usize
sourcefn encode(self, buf: &mut <DB as HasArguments<'q>>::ArgumentBuffer) -> IsNull
fn encode(self, buf: &mut <DB as HasArguments<'q>>::ArgumentBuffer) -> IsNull
Writes the value of self
into buf
in the expected format for the database.
fn produces(&self) -> Option<<DB as Database>::TypeInfo>
impl From<[u8; 6]> for MacAddress
impl From<[u8; 6]> for MacAddress
fn from(v: [u8; 6]) -> MacAddress
fn from(v: [u8; 6]) -> MacAddress
Converts to this type from the input type.
impl FromStr for MacAddress
impl FromStr for MacAddress
type Err = MacParseError
type Err = MacParseError
The associated error which can be returned from parsing.
fn from_str(input: &str) -> Result<MacAddress, <MacAddress as FromStr>::Err>
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
impl Hash for MacAddress
impl Ord for MacAddress
impl Ord for MacAddress
impl PartialEq<MacAddress> for MacAddress
impl PartialEq<MacAddress> for MacAddress
fn eq(&self, other: &MacAddress) -> bool
fn eq(&self, other: &MacAddress) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &MacAddress) -> bool
fn ne(&self, other: &MacAddress) -> bool
This method tests for !=
.
impl PartialOrd<MacAddress> for MacAddress
impl PartialOrd<MacAddress> for MacAddress
fn partial_cmp(&self, other: &MacAddress) -> Option<Ordering>
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 · 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 PgHasArrayType for MacAddress
impl PgHasArrayType for MacAddress
fn array_type_info() -> PgTypeInfo
fn array_compatible(ty: &PgTypeInfo) -> bool
impl<'_> TryFrom<&'_ str> for MacAddress
impl<'_> TryFrom<&'_ str> for MacAddress
type Error = MacParseError
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>
fn try_from(
value: &str
) -> Result<MacAddress, <MacAddress as TryFrom<&'_ str>>::Error>
Performs the conversion.
impl<'_> TryFrom<Cow<'_, str>> for MacAddress
impl<'_> TryFrom<Cow<'_, str>> for MacAddress
sourceimpl Type<Postgres> for MacAddress
impl Type<Postgres> for MacAddress
sourcefn type_info() -> PgTypeInfo
fn type_info() -> PgTypeInfo
Returns the canonical SQL type for this Rust type. Read more
sourcefn compatible(ty: &PgTypeInfo) -> bool
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
impl RefUnwindSafe for MacAddress
impl Send for MacAddress
impl Sync for MacAddress
impl Unpin for MacAddress
impl UnwindSafe for MacAddress
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<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
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