Struct diesel::pg::types::sql_types::MacAddr
[−]
[src]
pub struct MacAddr;
The MACADDR
SQL type. This type can only be used with feature = "network-address"
ToSql
impls
[u8; 6]
FromSql
impls
[u8; 6]
Examples
#[derive(Queryable)] struct Device { id: i32, macaddr: [u8; 6], } #[derive(Insertable)] #[table_name="devices"] struct NewDevice { macaddr: [u8;6], } table! { devices { id -> Integer, macaddr -> MacAddr, } } let new_device = NewDevice { macaddr: [0x08, 0x00, 0x2b, 0x01, 0x02, 0x03], }; let inserted_device = insert_into(devices).values(&new_device) .get_result::<Device>(&connection).unwrap(); assert_eq!([0x08, 0x00, 0x2b, 0x01, 0x02, 0x03], inserted_device.macaddr);
Trait Implementations
impl QueryId for MacAddr
[src]
type QueryId = Self
const HAS_STATIC_QUERY_ID: bool
HAS_STATIC_QUERY_ID: bool = true
fn query_id() -> Option<TypeId>
[src]
impl NotNull for MacAddr
[src]
impl SingleValue for MacAddr
[src]
impl Debug for MacAddr
[src]
impl Clone for MacAddr
[src]
fn clone(&self) -> MacAddr
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more