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]

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]

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

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

impl PartialEq<Identification> for NewIdentification<'_>[src]

impl PartialEq<NewIdentification<'_>> for Identification[src]

impl<'a, 'insert> UndecoratedInsertRecord<table> for NewIdentification<'a>[src]

impl<'a> Validate for NewIdentification<'a>[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]

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

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

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

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]

impl<T, U> IntoPy<U> for T where
    U: FromPy<T>, 
[src]

impl<T> IntoSql for T[src]

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]

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,