pub struct PurchaseBuilder<S: State = Empty> { /* private fields */ }Expand description
Use builder syntax to set the inputs and finish with build().
Implementations§
Source§impl<S: State> PurchaseBuilder<S>
impl<S: State> PurchaseBuilder<S>
Sourcepub fn build(self) -> Purchasewhere
S: IsComplete,
pub fn build(self) -> Purchasewhere
S: IsComplete,
Finish building and return the requested object
Sourcepub fn quantity(self, value: u32) -> PurchaseBuilder<SetQuantity<S>>where
S::Quantity: IsUnset,
pub fn quantity(self, value: u32) -> PurchaseBuilder<SetQuantity<S>>where
S::Quantity: IsUnset,
Required.
How many units were bought.
Sourcepub fn unit_price(self, value: Money) -> PurchaseBuilder<SetUnitPrice<S>>where
S::UnitPrice: IsUnset,
pub fn unit_price(self, value: Money) -> PurchaseBuilder<SetUnitPrice<S>>where
S::UnitPrice: IsUnset,
Required.
Price of one unit.
Sourcepub fn date(self, value: DateTime<Utc>) -> PurchaseBuilder<SetDate<S>>where
S::Date: IsUnset,
pub fn date(self, value: DateTime<Utc>) -> PurchaseBuilder<SetDate<S>>where
S::Date: IsUnset,
Sourcepub fn maybe_date(
self,
value: Option<DateTime<Utc>>,
) -> PurchaseBuilder<SetDate<S>>where
S::Date: IsUnset,
pub fn maybe_date(
self,
value: Option<DateTime<Utc>>,
) -> PurchaseBuilder<SetDate<S>>where
S::Date: IsUnset,
Auto Trait Implementations§
impl<S> Freeze for PurchaseBuilder<S>
impl<S> RefUnwindSafe for PurchaseBuilder<S>where
PhantomData<(fn() -> S, fn() -> PhantomData<Purchase>, fn() -> PhantomData<Uuid>)>: RefUnwindSafe,
impl<S> Send for PurchaseBuilder<S>
impl<S> Sync for PurchaseBuilder<S>
impl<S> Unpin for PurchaseBuilder<S>
impl<S> UnsafeUnpin for PurchaseBuilder<S>where
PhantomData<(fn() -> S, fn() -> PhantomData<Purchase>, fn() -> PhantomData<Uuid>)>: UnsafeUnpin,
impl<S> UnwindSafe for PurchaseBuilder<S>where
PhantomData<(fn() -> S, fn() -> PhantomData<Purchase>, fn() -> PhantomData<Uuid>)>: UnwindSafe,
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> 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 more