pub struct StorefrontStateStore { /* private fields */ }Implementations§
Source§impl StorefrontStateStore
impl StorefrontStateStore
pub fn open_for_plan(plan: &RuntimePlan) -> Result<Self, StorefrontStateError>
pub fn open_with_root( root: impl Into<PathBuf>, namespace: impl Into<String>, ) -> Result<Self, StorefrontStateError>
pub fn path(&self) -> &Path
pub fn snapshot( &self, session_id: &str, principal_id: Option<&str>, ) -> Result<StorefrontStateSnapshot, StorefrontStateError>
pub fn catalog(&self) -> Result<StorefrontCatalog, StorefrontStateError>
pub fn update_catalog_product( &self, update: &StorefrontCatalogProductUpdate, now_unix_seconds: u64, ) -> Result<StorefrontCatalog, StorefrontStateError>
pub fn update_catalog_collection( &self, update: &StorefrontCatalogCollectionUpdate, now_unix_seconds: u64, ) -> Result<StorefrontCatalog, StorefrontStateError>
pub fn add_to_cart( &self, session_id: &str, principal_id: Option<&str>, sku: &str, quantity: u32, now_unix_seconds: u64, ) -> Result<StorefrontStateSnapshot, StorefrontStateError>
pub fn update_cart( &self, session_id: &str, principal_id: Option<&str>, sku: &str, quantity: u32, now_unix_seconds: u64, ) -> Result<StorefrontStateSnapshot, StorefrontStateError>
pub fn checkout_start( &self, session_id: &str, principal_id: Option<&str>, now_unix_seconds: u64, ) -> Result<StorefrontStateSnapshot, StorefrontStateError>
pub fn checkout_complete( &self, session_id: &str, principal_id: Option<&str>, payment: &StorefrontPaymentInput, now_unix_seconds: u64, ) -> Result<StorefrontStateSnapshot, StorefrontStateError>
pub fn checkout_complete_with_metadata( &self, session_id: &str, principal_id: Option<&str>, payment: &StorefrontPaymentInput, order_metadata: &BTreeMap<String, String>, now_unix_seconds: u64, ) -> Result<StorefrontStateSnapshot, StorefrontStateError>
pub fn order_history( &self, session_id: &str, principal_id: Option<&str>, limit: usize, ) -> Result<StorefrontOrderHistoryResponse, StorefrontStateError>
pub fn admin_orders( &self, limit: usize, ) -> Result<Vec<StorefrontOrderSnapshot>, StorefrontStateError>
pub fn admin_order( &self, order_id: &str, ) -> Result<Option<StorefrontOrderSnapshot>, StorefrontStateError>
pub fn order_by_payment_reference( &self, payment_reference: &str, ) -> Result<Option<StorefrontOrderSnapshot>, StorefrontStateError>
pub fn refund_order( &self, order_id: &str, reason: &str, now_unix_seconds: u64, ) -> Result<StorefrontOrderSnapshot, StorefrontStateError>
pub fn fulfill_order( &self, order_id: &str, now_unix_seconds: u64, ) -> Result<StorefrontOrderSnapshot, StorefrontStateError>
pub fn apply_payment_webhook( &self, payment_reference: &str, event: &str, now_unix_seconds: u64, ) -> Result<StorefrontPaymentWebhookReceipt, StorefrontStateError>
pub fn mark_order_paid_event_dispatched( &self, order_id: &str, now_unix_seconds: u64, ) -> Result<(), StorefrontStateError>
pub fn build_response_augmentation( &self, route_name: &str, snapshot: &StorefrontStateSnapshot, csrf_tokens: BTreeMap<String, String>, ) -> Result<StorefrontResponseAugmentation, StorefrontStateError>
Trait Implementations§
Source§impl Clone for StorefrontStateStore
impl Clone for StorefrontStateStore
Source§fn clone(&self) -> StorefrontStateStore
fn clone(&self) -> StorefrontStateStore
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for StorefrontStateStore
impl RefUnwindSafe for StorefrontStateStore
impl Send for StorefrontStateStore
impl Sync for StorefrontStateStore
impl Unpin for StorefrontStateStore
impl UnsafeUnpin for StorefrontStateStore
impl UnwindSafe for StorefrontStateStore
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 more