pub struct Attachment {
pub id: i32,
pub name: String,
pub record_type: String,
pub record_id: i32,
pub blob_id: i32,
pub created_at: DateTime<Utc>,
}
Fields§
§id: i32
§name: String
§record_type: String
§record_id: i32
§blob_id: i32
§created_at: DateTime<Utc>
Implementations§
Source§impl Attachment
impl Attachment
Sourcepub async fn attach(
db: &mut Connection,
storage: &Storage,
name: String,
record_type: String,
record_id: i32,
data: AttachmentData,
allow_multiple: bool,
overwrite_existing: bool,
) -> Result<String, String>
pub async fn attach( db: &mut Connection, storage: &Storage, name: String, record_type: String, record_id: i32, data: AttachmentData, allow_multiple: bool, overwrite_existing: bool, ) -> Result<String, String>
in actix_web
we don’t need to support send+sync handlers, so we can use the &mut Connection
directly.
§Errors
- Diesel error
Sourcepub async fn detach(
db: &mut Connection,
storage: &Storage,
item_id: i32,
) -> Result<(), String>
pub async fn detach( db: &mut Connection, storage: &Storage, item_id: i32, ) -> Result<(), String>
in actix_web
we don’t need to support send+sync handlers, so we can use the &mut Connection directly.
§Errors
- Diesel error
Sourcepub async fn detach_all(
db: &mut Connection,
storage: &Storage,
name: String,
record_type: String,
record_id: i32,
) -> Result<(), String>
pub async fn detach_all( db: &mut Connection, storage: &Storage, name: String, record_type: String, record_id: i32, ) -> Result<(), String>
§Errors
- Diesel error
Sourcepub fn find_for_record(
db: &mut Connection,
item_name: String,
item_record_type: String,
item_record_id: i32,
) -> QueryResult<Self>
pub fn find_for_record( db: &mut Connection, item_name: String, item_record_type: String, item_record_id: i32, ) -> QueryResult<Self>
Sourcepub fn find_all_for_record(
db: &mut Connection,
item_name: String,
item_record_type: String,
item_record_id: i32,
) -> QueryResult<Vec<Self>>
pub fn find_all_for_record( db: &mut Connection, item_name: String, item_record_type: String, item_record_id: i32, ) -> QueryResult<Vec<Self>>
Sourcepub fn find_all_for_records(
db: &mut Connection,
item_name: String,
item_record_type: String,
item_record_ids: Vec<i32>,
) -> QueryResult<Vec<Self>>
pub fn find_all_for_records( db: &mut Connection, item_name: String, item_record_type: String, item_record_ids: Vec<i32>, ) -> QueryResult<Vec<Self>>
Trait Implementations§
Source§impl<'update> AsChangeset for &'update Attachment
impl<'update> AsChangeset for &'update Attachment
Source§type Changeset = <(Grouped<Eq<name, <&'update String as AsExpression<<name as Expression>::SqlType>>::Expression>>, Grouped<Eq<record_type, <&'update String as AsExpression<<record_type as Expression>::SqlType>>::Expression>>, Grouped<Eq<record_id, <&'update i32 as AsExpression<<record_id as Expression>::SqlType>>::Expression>>, Grouped<Eq<blob_id, <&'update i32 as AsExpression<<blob_id as Expression>::SqlType>>::Expression>>, Grouped<Eq<created_at, <&'update DateTime<Utc> as AsExpression<<created_at as Expression>::SqlType>>::Expression>>) as AsChangeset>::Changeset
type Changeset = <(Grouped<Eq<name, <&'update String as AsExpression<<name as Expression>::SqlType>>::Expression>>, Grouped<Eq<record_type, <&'update String as AsExpression<<record_type as Expression>::SqlType>>::Expression>>, Grouped<Eq<record_id, <&'update i32 as AsExpression<<record_id as Expression>::SqlType>>::Expression>>, Grouped<Eq<blob_id, <&'update i32 as AsExpression<<blob_id as Expression>::SqlType>>::Expression>>, Grouped<Eq<created_at, <&'update DateTime<Utc> as AsExpression<<created_at as Expression>::SqlType>>::Expression>>) as AsChangeset>::Changeset
The update statement this type represents
Source§fn as_changeset(self) -> <Self as AsChangeset>::Changeset
fn as_changeset(self) -> <Self as AsChangeset>::Changeset
Convert
self
into the actual update statement being executedSource§impl AsChangeset for Attachment
impl AsChangeset for Attachment
Source§type Changeset = <(Grouped<Eq<name, <String as AsExpression<<name as Expression>::SqlType>>::Expression>>, Grouped<Eq<record_type, <String as AsExpression<<record_type as Expression>::SqlType>>::Expression>>, Grouped<Eq<record_id, <i32 as AsExpression<<record_id as Expression>::SqlType>>::Expression>>, Grouped<Eq<blob_id, <i32 as AsExpression<<blob_id as Expression>::SqlType>>::Expression>>, Grouped<Eq<created_at, <DateTime<Utc> as AsExpression<<created_at as Expression>::SqlType>>::Expression>>) as AsChangeset>::Changeset
type Changeset = <(Grouped<Eq<name, <String as AsExpression<<name as Expression>::SqlType>>::Expression>>, Grouped<Eq<record_type, <String as AsExpression<<record_type as Expression>::SqlType>>::Expression>>, Grouped<Eq<record_id, <i32 as AsExpression<<record_id as Expression>::SqlType>>::Expression>>, Grouped<Eq<blob_id, <i32 as AsExpression<<blob_id as Expression>::SqlType>>::Expression>>, Grouped<Eq<created_at, <DateTime<Utc> as AsExpression<<created_at as Expression>::SqlType>>::Expression>>) as AsChangeset>::Changeset
The update statement this type represents
Source§fn as_changeset(self) -> <Self as AsChangeset>::Changeset
fn as_changeset(self) -> <Self as AsChangeset>::Changeset
Convert
self
into the actual update statement being executedSource§impl Clone for Attachment
impl Clone for Attachment
Source§fn clone(&self) -> Attachment
fn clone(&self) -> Attachment
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Attachment
impl Debug for Attachment
Source§impl<'de> Deserialize<'de> for Attachment
impl<'de> Deserialize<'de> for Attachment
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 Attachment
impl HasTable for Attachment
Source§impl<'ident> Identifiable for &'ident Attachment
impl<'ident> Identifiable for &'ident Attachment
Source§impl<__DB: Backend, __ST0, __ST1, __ST2, __ST3, __ST4, __ST5> Queryable<(__ST0, __ST1, __ST2, __ST3, __ST4, __ST5), __DB> for Attachmentwhere
(i32, String, String, i32, i32, DateTime<Utc>): FromStaticSqlRow<(__ST0, __ST1, __ST2, __ST3, __ST4, __ST5), __DB>,
impl<__DB: Backend, __ST0, __ST1, __ST2, __ST3, __ST4, __ST5> Queryable<(__ST0, __ST1, __ST2, __ST3, __ST4, __ST5), __DB> for Attachmentwhere
(i32, String, String, i32, i32, DateTime<Utc>): FromStaticSqlRow<(__ST0, __ST1, __ST2, __ST3, __ST4, __ST5), __DB>,
Auto Trait Implementations§
impl Freeze for Attachment
impl RefUnwindSafe for Attachment
impl Send for Attachment
impl Sync for Attachment
impl Unpin for Attachment
impl UnwindSafe for Attachment
Blanket Implementations§
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
Convert
self
to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
Convert
&self
to an expression for Diesel’s query builder. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T, ST, DB> StaticallySizedRow<ST, DB> for T
impl<T, ST, DB> StaticallySizedRow<ST, DB> for T
Source§const FIELD_COUNT: usize = <ST as crate::util::TupleSize>::SIZE
const FIELD_COUNT: usize = <ST as crate::util::TupleSize>::SIZE
The number of fields that this type will consume.