[−][src]Struct ergol::relation::OneToOne
A one to one relation ship.
You should not use this type by yourself, it should be automatically generated by the
#[one_to_one]
macro attribute.
Implementations
impl<T: ToTable> OneToOne<T>
[src]
pub fn new(id: i32) -> OneToOne<T>
[src]
Creates a one to one relation ship.
pub async fn fetch<'_, '_>(&'_ self, client: &'_ Client) -> Result<T, Error>
[src]
Fetches the referenced element.
Trait Implementations
impl<T: Clone + ToTable> Clone for OneToOne<T>
[src]
impl<T: Copy + ToTable> Copy for OneToOne<T>
[src]
impl<T: Debug + ToTable> Debug for OneToOne<T>
[src]
impl<T: ToTable, '_> From<&'_ T> for OneToOne<T>
[src]
impl<T: ToTable> From<T> for OneToOne<T>
[src]
impl<'a, T: ToTable> FromSql<'a> for OneToOne<T>
[src]
pub fn from_sql(
ty: &Type,
raw: &'a [u8]
) -> Result<Self, Box<dyn Error + Sync + Send + 'static>>
[src]
ty: &Type,
raw: &'a [u8]
) -> Result<Self, Box<dyn Error + Sync + Send + 'static>>
pub fn accepts(ty: &Type) -> bool
[src]
pub fn from_sql_null(
ty: &Type
) -> Result<Self, Box<dyn Error + 'static + Send + Sync, Global>>
[src]
ty: &Type
) -> Result<Self, Box<dyn Error + 'static + Send + Sync, Global>>
pub fn from_sql_nullable(
ty: &Type,
raw: Option<&'a [u8]>
) -> Result<Self, Box<dyn Error + 'static + Send + Sync, Global>>
[src]
ty: &Type,
raw: Option<&'a [u8]>
) -> Result<Self, Box<dyn Error + 'static + Send + Sync, Global>>
impl<T: ToTable> Pg for OneToOne<T>
[src]
impl<T: ToTable, U: ToTable> Relation<U> for OneToOne<T>
[src]
type Target = T
The type to which your struct will be linked.
type Reverse = Option<U>
The type to which the linked struct will be linked.
pub fn from_rows(rows: Vec<Row>) -> Self::Reverse
[src]
impl<T: ToTable> ToSql for OneToOne<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for OneToOne<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for OneToOne<T>
impl<T> Sync for OneToOne<T> where
T: Sync,
T: Sync,
impl<T> Unpin for OneToOne<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for OneToOne<T> where
T: UnwindSafe,
T: UnwindSafe,
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> From<!> for T
[src]
impl<T> From<T> for T
[src]
impl<T> FromSqlOwned for T where
T: for<'a> FromSql<'a>,
[src]
T: for<'a> FromSql<'a>,
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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>,