Struct sn0int::models::NetworkDevice
source · 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: i32
§network_id: i32
§device_id: i32
§ipaddr: Option<String>
§last_seen: Option<NaiveDateTime>
Implementations§
Trait Implementations§
source§impl<__FK> BelongsTo<Device> for NetworkDevicewhere
__FK: Hash + Eq,
for<'__a> &'__a i32: Into<Option<&'__a __FK>>,
for<'__a> &'__a Device: Identifiable<Id = &'__a __FK>,
impl<__FK> BelongsTo<Device> for NetworkDevicewhere __FK: Hash + Eq, for<'__a> &'__a i32: Into<Option<&'__a __FK>>, for<'__a> &'__a Device: Identifiable<Id = &'__a __FK>,
§type ForeignKey = __FK
type ForeignKey = __FK
The foreign key of this struct
§type ForeignKeyColumn = device_id
type ForeignKeyColumn = device_id
The database column representing the foreign key
of the table this struct represents
source§fn foreign_key(&self) -> Option<&Self::ForeignKey>
fn foreign_key(&self) -> Option<&Self::ForeignKey>
Returns the foreign key for
self
source§fn foreign_key_column() -> Self::ForeignKeyColumn
fn foreign_key_column() -> Self::ForeignKeyColumn
Returns the foreign key column of this struct’s table
source§impl<__FK> BelongsTo<Network> for NetworkDevicewhere
__FK: Hash + Eq,
for<'__a> &'__a i32: Into<Option<&'__a __FK>>,
for<'__a> &'__a Network: Identifiable<Id = &'__a __FK>,
impl<__FK> BelongsTo<Network> for NetworkDevicewhere __FK: Hash + Eq, for<'__a> &'__a i32: Into<Option<&'__a __FK>>, for<'__a> &'__a Network: Identifiable<Id = &'__a __FK>,
§type ForeignKey = __FK
type ForeignKey = __FK
The foreign key of this struct
§type ForeignKeyColumn = network_id
type ForeignKeyColumn = network_id
The database column representing the foreign key
of the table this struct represents
source§fn foreign_key(&self) -> Option<&Self::ForeignKey>
fn foreign_key(&self) -> Option<&Self::ForeignKey>
Returns the foreign key for
self
source§fn foreign_key_column() -> Self::ForeignKeyColumn
fn foreign_key_column() -> Self::ForeignKeyColumn
Returns the foreign key column of this struct’s table
source§impl<'de> Deserialize<'de> for NetworkDevice
impl<'de> Deserialize<'de> for NetworkDevice
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 HasTable for NetworkDevice
impl HasTable for NetworkDevice
source§impl<'ident> Identifiable for &'ident NetworkDevice
impl<'ident> Identifiable for &'ident NetworkDevice
source§impl Model for NetworkDevice
impl Model for NetworkDevice
type ID = (i32, i32)
fn to_string(&self) -> String
fn list(db: &Database) -> Result<Vec<Self>>
fn filter(db: &Database, filter: &Filter) -> Result<Vec<Self>>
fn delete(db: &Database, filter: &Filter) -> Result<usize>
fn delete_id(db: &Database, my_id: i32) -> Result<usize>
fn id(&self) -> i32
fn by_id(db: &Database, my_id: i32) -> Result<Self>
fn get(db: &Database, query: &Self::ID) -> Result<Self>
fn get_opt(db: &Database, query: &Self::ID) -> Result<Option<Self>>
fn filter_with_param( _db: &Database, _filter: &Filter, _param: &str ) -> Result<Vec<Self>>
fn value(&self) -> &Self::ID
fn get_id(db: &Database, query: &Self::ID) -> Result<i32>
fn get_id_opt(db: &Database, query: &Self::ID) -> Result<Option<i32>>
fn blob(&self) -> Option<&str>
source§impl<__DB: Backend, __ST> Queryable<__ST, __DB> for NetworkDevicewhere
(i32, i32, i32, Option<String>, Option<NaiveDateTime>): Queryable<__ST, __DB>,
impl<__DB: Backend, __ST> Queryable<__ST, __DB> for NetworkDevicewhere (i32, i32, i32, Option<String>, Option<NaiveDateTime>): Queryable<__ST, __DB>,
source§impl Serialize for NetworkDevice
impl Serialize for NetworkDevice
source§impl Updateable<NetworkDevice> for NetworkDeviceUpdate
impl Updateable<NetworkDevice> for NetworkDeviceUpdate
fn changeset(&mut self, existing: &NetworkDevice)
fn fmt(&self, updates: &mut Vec<String>, colors: bool)
fn to_plain_str(&self) -> String
fn to_term_str(&self) -> String
fn clear_if_equal<T: PartialEq>(update: &mut Option<T>, existing: &Option<T>)
fn clear_if_lower_or_equal<T: PartialOrd>( update: &mut Option<T>, existing: &Option<T> )
fn clear_if_greater_or_equal<T: PartialOrd>( update: &mut Option<T>, existing: &Option<T> )
fn push_value<D: Debug>( updates: &mut Vec<String>, name: &str, value: &Option<D>, colors: bool )
fn push_raw<T: AsRef<str>>( updates: &mut Vec<String>, name: &str, value: Option<T>, colors: bool )
source§impl Upsertable<NetworkDevice> for NewNetworkDevice
impl Upsertable<NetworkDevice> for NewNetworkDevice
type Update = NetworkDeviceUpdate
fn upsert(self, existing: &NetworkDevice) -> Self::Update
fn upsert_opt<T: PartialEq>( insert: Option<T>, existing: &Option<T> ) -> Option<T>
Auto Trait Implementations§
impl RefUnwindSafe for NetworkDevice
impl Send for NetworkDevice
impl Sync for NetworkDevice
impl Unpin for NetworkDevice
impl UnwindSafe for NetworkDevice
Blanket Implementations§
§impl<'a, T> AsTaggedExplicit<'a> for Twhere
T: 'a,
impl<'a, T> AsTaggedExplicit<'a> for Twhere T: 'a,
§impl<'a, T> AsTaggedImplicit<'a> for Twhere
T: 'a,
impl<'a, T> AsTaggedImplicit<'a> for Twhere T: 'a,
source§impl<'a, Parent, Child> BelongingToDsl<&'a [Parent]> for Childwhere
&'a Parent: Identifiable,
Child: HasTable + BelongsTo<Parent>,
Vec<<&'a Parent as Identifiable>::Id, Global>: 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, Global> as AsInExpression<<<Child as BelongsTo<Parent>>::ForeignKeyColumn as Expression>::SqlType>>::InExpression>>,
<Child as BelongsTo<Parent>>::ForeignKeyColumn: ExpressionMethods,
impl<'a, Parent, Child> BelongingToDsl<&'a [Parent]> for Childwhere &'a Parent: Identifiable, Child: HasTable + BelongsTo<Parent>, Vec<<&'a Parent as Identifiable>::Id, Global>: 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, Global> as AsInExpression<<<Child as BelongsTo<Parent>>::ForeignKeyColumn as Expression>::SqlType>>::InExpression>>, <Child as BelongsTo<Parent>>::ForeignKeyColumn: ExpressionMethods,
§type Output = <<Child as HasTable>::Table as FilterDsl<In<<Child as BelongsTo<Parent>>::ForeignKeyColumn, <Vec<<&'a Parent as Identifiable>::Id, Global> as AsInExpression<<<Child as BelongsTo<Parent>>::ForeignKeyColumn as Expression>::SqlType>>::InExpression>>>::Output
type Output = <<Child as HasTable>::Table as FilterDsl<In<<Child as BelongsTo<Parent>>::ForeignKeyColumn, <Vec<<&'a Parent as Identifiable>::Id, Global> as AsInExpression<<<Child as BelongsTo<Parent>>::ForeignKeyColumn as Expression>::SqlType>>::InExpression>>>::Output
The query returned by
belonging_to
source§fn belonging_to(
parents: &'a [Parent]
) -> <Child as BelongingToDsl<&'a [Parent]>>::Output
fn belonging_to( parents: &'a [Parent] ) -> <Child as BelongingToDsl<&'a [Parent]>>::Output
Get the record(s) belonging to record(s)
other
source§impl<'a, Parent, Child> BelongingToDsl<&'a Vec<Parent, Global>> for Childwhere
Child: BelongingToDsl<&'a [Parent]>,
impl<'a, Parent, Child> BelongingToDsl<&'a Vec<Parent, Global>> for Childwhere Child: BelongingToDsl<&'a [Parent]>,
§type Output = <Child as BelongingToDsl<&'a [Parent]>>::Output
type Output = <Child as BelongingToDsl<&'a [Parent]>>::Output
The query returned by
belonging_to
source§fn belonging_to(
parents: &'a Vec<Parent, Global>
) -> <Child as BelongingToDsl<&'a Vec<Parent, Global>>>::Output
fn belonging_to( parents: &'a Vec<Parent, Global> ) -> <Child as BelongingToDsl<&'a Vec<Parent, Global>>>::Output
Get the record(s) belonging to record(s)
other
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> IntoSql for T
impl<T> IntoSql for T
source§fn into_sql<T>(self) -> Self::Expressionwhere
Self: AsExpression<T> + Sized,
fn into_sql<T>(self) -> Self::Expressionwhere Self: AsExpression<T> + Sized,
Convert
self
to an expression for Diesel’s query builder. Read moresource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere &'a Self: AsExpression<T>,
Convert
&self
to an expression for Diesel’s query builder. Read more