Order

Struct Order 

Source
pub struct Order {
    pub id: Passive<Uuid>,
    pub customer_id: Uuid,
    pub country: String,
    pub total: FixedDecimal<16, 2>,
    pub status: String,
    pub created_at: DateTime<Utc>,
}

Fields§

§id: Passive<Uuid>§customer_id: Uuid§country: String§total: FixedDecimal<16, 2>§status: String§created_at: DateTime<Utc>

Trait Implementations§

Source§

impl Clone for Order

Source§

fn clone(&self) -> Order

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Order

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Entity for Order

Source§

type PrimaryKey<'a> = (&'a Passive<Uuid>,)

Primary key type. Tuple of the types of the fields forming the primary key.
Source§

fn table() -> &'static TableRef

Returns the table reference backing this entity.
Source§

fn columns() -> &'static [ColumnDef]

Returns all declared column definitions in declaration order.
Source§

fn primary_key_def() -> impl ExactSizeIterator<Item = &'static ColumnDef>

Iterator over columns forming the primary key. Empty iterator means no PK.
Source§

fn primary_key<'a>(&'a self) -> Self::PrimaryKey<'a>

Extracts the primary key value(s) from self.
Source§

fn unique_defs() -> impl ExactSizeIterator<Item = impl ExactSizeIterator<Item = &'static ColumnDef>>

Returns an iterator over unique constraint definitions.
Source§

fn row_filtered(&self) -> Box<[(&'static str, Value)]>

Returns a filtered mapping of column name to value, typically excluding auto-generated or default-only columns.
Source§

fn row_full(&self) -> Row

Returns a full Row representation including all persisted columns.
Source§

fn from_row(row: RowLabeled) -> Result<Self>

Constructs Self from a labeled database row. Read more
Source§

fn find_pk( executor: &mut impl Executor, primary_key: &Self::PrimaryKey<'_>, ) -> impl Future<Output = Result<Option<Self>>>

Finds an entity by primary key. Read more
Source§

fn delete_one( executor: &mut impl Executor, primary_key: Self::PrimaryKey<'_>, ) -> impl Future<Output = Result<RowsAffected>> + Send
where Self: Sized,

Deletes exactly one entity by primary key. Read more
Source§

fn create_table( executor: &mut impl Executor, if_not_exists: bool, create_schema: bool, ) -> impl Future<Output = Result<(), Error>> + Send
where Self: Sized,

Creates the underlying table (and optionally schema) if requested. Read more
Source§

fn drop_table( executor: &mut impl Executor, if_exists: bool, drop_schema: bool, ) -> impl Future<Output = Result<(), Error>> + Send
where Self: Sized,

Drops the underlying table (and optionally schema) if requested. Read more
Source§

fn insert_one( executor: &mut impl Executor, entity: &impl Entity, ) -> impl Future<Output = Result<RowsAffected, Error>> + Send

Inserts a single entity row. Read more
Source§

fn insert_many<'a, It>( executor: &mut impl Executor, items: It, ) -> impl Future<Output = Result<RowsAffected, Error>> + Send
where Self: Sized + 'a, It: IntoIterator<Item = &'a Self> + Send, <It as IntoIterator>::IntoIter: Send,

Multiple insert for a homogeneous iterator of entities. Read more
Source§

fn prepare_find<Exec>( executor: &mut Exec, condition: &impl Expression, limit: Option<u32>, ) -> impl Future<Output = Result<Query<<Exec as Executor>::Driver>, Error>>
where Exec: Executor,

Prepare (but do not yet run) a SQL select query. Read more
Source§

fn find_one( executor: &mut impl Executor, condition: &impl Expression, ) -> impl Future<Output = Result<Option<Self>, Error>> + Send
where Self: Sized,

Finds the first entity matching a condition expression. Read more
Source§

fn find_many( executor: &mut impl Executor, condition: impl Expression, limit: Option<u32>, ) -> impl Stream<Item = Result<Self, Error>> + Send
where Self: Sized,

Streams entities matching a condition. Read more
Source§

fn delete_many( executor: &mut impl Executor, condition: &impl Expression, ) -> impl Future<Output = Result<RowsAffected, Error>> + Send
where Self: Sized,

Deletes all entities matching a condition. Read more
Source§

fn save( &self, executor: &mut impl Executor, ) -> impl Future<Output = Result<(), Error>> + Send
where Self: Sized,

Saves the entity (insert or update if available) based on primary key presence. Read more
Source§

fn delete( &self, executor: &mut impl Executor, ) -> impl Future<Output = Result<(), Error>> + Send
where Self: Sized,

Deletes this entity instance via its primary key. Read more
Source§

impl Hash for Order

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Order

Source§

fn eq(&self, other: &Order) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Order

Source§

impl StructuralPartialEq for Order

Auto Trait Implementations§

§

impl Freeze for Order

§

impl RefUnwindSafe for Order

§

impl Send for Order

§

impl Sync for Order

§

impl Unpin for Order

§

impl UnwindSafe for Order

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<E> DataSet for E
where E: Entity,

Source§

fn qualified_columns() -> bool

Indicates whether column names should be fully qualified with schema and table name.

For entities this returns false to keep queries concise, for joins it returns true.

Source§

fn write_query( &self, writer: &dyn SqlWriter, context: &mut Context, out: &mut String, )

Writes the table reference into the out string.

Source§

fn select<'s, Exec, Item, Cols, Expr>( &'s self, executor: &'s mut Exec, columns: Cols, condition: Expr, limit: Option<u32>, ) -> impl Stream<Item = Result<RowLabeled, Error>> + 's
where Self: Sized, Exec: Executor, Item: Expression, Cols: IntoIterator<Item = Item> + Clone, Expr: Expression,

Fetch a SELECT query and stream labeled rows.
Source§

fn prepare<Exec, Item, Cols, Expr>( &self, executor: &mut Exec, columns: Cols, condition: &Expr, limit: Option<u32>, ) -> impl Future<Output = Result<Query<<Exec as Executor>::Driver>, Error>>
where Self: Sized, Item: Expression, Cols: IntoIterator<Item = Item> + Clone, Exec: Executor, Expr: Expression,

Prepare a SELECT query.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.