[][src]Struct sn0int::models::NetworkDevice

pub struct NetworkDevice {
    pub id: i32,
    pub network_id: i32,
    pub device_id: i32,
    pub ipaddr: Option<String>,
    pub last_seen: Option<NaiveDateTime>,
}

Fields

id: i32network_id: i32device_id: i32ipaddr: Option<String>last_seen: Option<NaiveDateTime>

Methods

impl NetworkDevice
[src]

pub fn network(&self, db: &Database) -> Result<Network>
[src]

Trait Implementations

impl Model for NetworkDevice
[src]

type ID = (i32, i32)

fn value(&self) -> &Self::ID
[src]

fn get_id(db: &Database, query: &Self::ID) -> Result<i32>
[src]

fn get_id_opt(db: &Database, query: &Self::ID) -> Result<Option<i32>>
[src]

impl<'a> Upsertable<NetworkDevice> for NewNetworkDevice<'a>
[src]

type Update = NetworkDeviceUpdate

fn upsert_str(
    insert: Option<&String>,
    existing: &Option<String>
) -> Option<String>
[src]

fn upsert_bytes(
    insert: Option<&Vec<u8>>,
    existing: &Option<Vec<u8>>
) -> Option<Vec<u8>>
[src]

fn upsert_opt<T: PartialEq>(
    insert: Option<T>,
    existing: &Option<T>
) -> Option<T>
[src]

impl Updateable<NetworkDevice> for NetworkDeviceUpdate
[src]

fn to_string(&self) -> String
[src]

fn clear_if_equal<T: PartialEq>(update: &mut Option<T>, existing: &Option<T>)
[src]

fn push_value<D: Debug>(
    updates: &mut Vec<String>,
    name: &str,
    value: &Option<D>
)
[src]

fn push_raw<T: AsRef<str>>(
    updates: &mut Vec<String>,
    name: &str,
    value: Option<T>
)
[src]

impl Printable<PrintableNetworkDevice> for NetworkDevice
[src]

impl BelongsTo<Network> for NetworkDevice
[src]

type ForeignKey = i32

The foreign key of this struct

type ForeignKeyColumn = network_id

The database column representing the foreign key of the table this struct represents Read more

impl BelongsTo<Device> for NetworkDevice
[src]

type ForeignKey = i32

The foreign key of this struct

type ForeignKeyColumn = device_id

The database column representing the foreign key of the table this struct represents Read more

impl HasTable for NetworkDevice
[src]

type Table = table

The table this type is associated with.

impl<'ident> Identifiable for &'ident NetworkDevice
[src]

type Id = &'ident i32

The type of this struct's identifier. Read more

impl<__DB: Backend, __ST> Queryable<__ST, __DB> for NetworkDevice where
    (i32, i32, i32, Option<String>, Option<NaiveDateTime>): Queryable<__ST, __DB>, 
[src]

type Row = <(i32, i32, i32, Option<String>, Option<NaiveDateTime>) as Queryable<__ST, __DB>>::Row

The Rust type you'd like to map from. Read more

impl Serialize for NetworkDevice
[src]

impl<'de> Deserialize<'de> for NetworkDevice
[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> IntoSql for T
[src]

fn into_sql<T>(self) -> Self::Expression where
    Self: AsExpression<T>, 
[src]

Convert self to an expression for Diesel's query builder. Read more

fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
    &'a Self: AsExpression<T>, 
[src]

Convert &self to an expression for Diesel's query builder. Read more

impl<'a, Parent, Child> BelongingToDsl for Child where
    Child: HasTable + BelongsTo<Parent>,
    &'a Parent: Identifiable,
    <&'a Parent as Identifiable>::Id: AsExpression<<<Child as BelongsTo<Parent>>::ForeignKeyColumn as Expression>::SqlType>,
    <Child as HasTable>::Table: FilterDsl<Eq<<Child as BelongsTo<Parent>>::ForeignKeyColumn, <<&'a Parent as Identifiable>::Id as AsExpression<<<Child as BelongsTo<Parent>>::ForeignKeyColumn as Expression>::SqlType>>::Expression>>,
    <Child as BelongsTo<Parent>>::ForeignKeyColumn: ExpressionMethods
[src]

type Output = <<Child as HasTable>::Table as FilterDsl<Eq<<Child as BelongsTo<Parent>>::ForeignKeyColumn, <<&'a Parent as Identifiable>::Id as AsExpression<<<Child as BelongsTo<Parent>>::ForeignKeyColumn as Expression>::SqlType>>::Expression>>>::Output

The query returned by belonging_to

impl<'a, Parent, Child> BelongingToDsl for Child where
    Child: HasTable + BelongsTo<Parent>,
    &'a Parent: Identifiable,
    Vec<<&'a Parent as Identifiable>::Id>: AsInExpression<<<Child as BelongsTo<Parent>>::ForeignKeyColumn as Expression>::SqlType>,
    <Child as HasTable>::Table: FilterDsl<In<<Child as BelongsTo<Parent>>::ForeignKeyColumn, <Vec<<&'a Parent as Identifiable>::Id> as AsInExpression<<<Child as BelongsTo<Parent>>::ForeignKeyColumn as Expression>::SqlType>>::InExpression>>,
    <Child as BelongsTo<Parent>>::ForeignKeyColumn: ExpressionMethods
[src]

type Output = <<Child as HasTable>::Table as FilterDsl<In<<Child as BelongsTo<Parent>>::ForeignKeyColumn, <Vec<<&'a Parent as Identifiable>::Id> as AsInExpression<<<Child as BelongsTo<Parent>>::ForeignKeyColumn as Expression>::SqlType>>::InExpression>>>::Output

The query returned by belonging_to

impl<'a, Parent, Child> BelongingToDsl for Child where
    Child: BelongingToDsl<&'a [Parent]>, 
[src]

type Output = <Child as BelongingToDsl<&'a [Parent]>>::Output

The query returned by belonging_to

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

impl<T> Erased for T