Struct got_ya_id::apps::ids::models::NewIdentification [−][src]
pub struct NewIdentification<'a> { pub name: Cow<'a, str>, pub course: Cow<'a, str>, pub valid_from: Option<NaiveDate>, pub valid_till: Option<NaiveDate>, pub posted_by: Option<i32>, // some fields omitted }
The Insertable new Identification record
Fields
name: Cow<'a, str>
course: Cow<'a, str>
valid_from: Option<NaiveDate>
valid_till: Option<NaiveDate>
posted_by: Option<i32>
Implementations
impl<'a> NewIdentification<'a>
[src]
pub async fn save(&self) -> Result<Identification, ResError>
[src]
Saves a new ID record to the Identifications table
pub async fn is_possible_match(
idt: &Identification,
claim: &ClaimableIdentification
) -> bool
[src]
idt: &Identification,
claim: &ClaimableIdentification
) -> bool
Finds the similarity between a Claim and this Identification, returning true if the Claim is a possible match.
Matching metric is cosine similarity.
Trait Implementations
impl<'de, 'a> Deserialize<'de> for NewIdentification<'a>
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl From<&'_ NewIdentification<'_>> for Identification
[src]
fn from(new_idt: &NewIdentification<'_>) -> Self
[src]
Desired fields are those used in comparison between Identifications ans ClaimableIdentifications.
Usable fields are only: name, course, campus, valid_from, valid_till, institution
impl<'a, 'insert> Insertable<table> for NewIdentification<'a>
[src]
type Values = <(Option<Eq<name, Cow<'a, str>>>, Option<Eq<course, Cow<'a, str>>>, Option<Eq<valid_from, NaiveDate>>, Option<Eq<valid_till, NaiveDate>>, Option<Eq<institution, Cow<'a, str>>>, Option<Eq<campus, Cow<'a, str>>>, Option<Eq<location_name, Cow<'a, str>>>, Option<Eq<posted_by, i32>>, Option<Eq<about, Cow<'a, str>>>, Option<Eq<location_latitude, f64>>, Option<Eq<location_longitude, f64>>) as Insertable<table>>::Values
The VALUES
clause to insert these records Read more
fn values(self) -> Self::Values
[src]
pub fn insert_into(
self,
table: T
) -> InsertStatement<T, Self::Values, Insert, NoReturningClause>
[src]
self,
table: T
) -> InsertStatement<T, Self::Values, Insert, NoReturningClause>
impl<'a, 'insert> Insertable<table> for &'insert NewIdentification<'a>
[src]
type Values = <(Option<Eq<name, &'insert Cow<'a, str>>>, Option<Eq<course, &'insert Cow<'a, str>>>, Option<Eq<valid_from, &'insert NaiveDate>>, Option<Eq<valid_till, &'insert NaiveDate>>, Option<Eq<institution, &'insert Cow<'a, str>>>, Option<Eq<campus, &'insert Cow<'a, str>>>, Option<Eq<location_name, &'insert Cow<'a, str>>>, Option<Eq<posted_by, &'insert i32>>, Option<Eq<about, &'insert Cow<'a, str>>>, Option<Eq<location_latitude, &'insert f64>>, Option<Eq<location_longitude, &'insert f64>>) as Insertable<table>>::Values
The VALUES
clause to insert these records Read more
fn values(self) -> Self::Values
[src]
pub fn insert_into(
self,
table: T
) -> InsertStatement<T, Self::Values, Insert, NoReturningClause>
[src]
self,
table: T
) -> InsertStatement<T, Self::Values, Insert, NoReturningClause>
impl PartialEq<Identification> for NewIdentification<'_>
[src]
fn eq(&self, idt: &Identification) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn ne(&self, other: &Rhs) -> boolimpl PartialEq<NewIdentification<'_>> for Identification
[src]
fn eq(&self, idt: &NewIdentification<'_>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn ne(&self, other: &Rhs) -> boolimpl<'a, 'insert> UndecoratedInsertRecord<table> for NewIdentification<'a>
[src]
impl<'a> Validate for NewIdentification<'a>
[src]
fn validate(&self) -> Result<(), ValidationErrors>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for NewIdentification<'a>
impl<'a> Send for NewIdentification<'a>
impl<'a> Sync for NewIdentification<'a>
impl<'a> Unpin for NewIdentification<'a>
impl<'a> UnwindSafe for NewIdentification<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T> FromPy<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> IntoPy<U> for T where
U: FromPy<T>,
[src]
U: FromPy<T>,
impl<T> IntoSql for T
[src]
pub fn into_sql<T>(self) -> Self::Expression where
Self: AsExpression<T>,
[src]
Self: AsExpression<T>,
pub fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
&'a Self: AsExpression<T>,
[src]
&'a Self: AsExpression<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,