pub struct SqliteCartRepository { /* private fields */ }Available on crate feature
sqlite only.Expand description
SQLite implementation of CartRepository
Implementations§
Source§impl SqliteCartRepository
impl SqliteCartRepository
pub const fn new(pool: Pool<SqliteConnectionManager>) -> Self
Trait Implementations§
Source§impl CartRepository for SqliteCartRepository
impl CartRepository for SqliteCartRepository
Source§fn for_customer(&self, customer_id: CustomerId) -> Result<Vec<Cart>>
fn for_customer(&self, customer_id: CustomerId) -> Result<Vec<Cart>>
Get carts for a customer
Source§fn update_item(&self, item_id: Uuid, input: UpdateCartItem) -> Result<CartItem>
fn update_item(&self, item_id: Uuid, input: UpdateCartItem) -> Result<CartItem>
Update a cart item (quantity, etc)
Source§fn set_shipping_address(&self, id: CartId, address: CartAddress) -> Result<Cart>
fn set_shipping_address(&self, id: CartId, address: CartAddress) -> Result<Cart>
Set shipping address
Source§fn set_billing_address(&self, id: CartId, address: CartAddress) -> Result<Cart>
fn set_billing_address(&self, id: CartId, address: CartAddress) -> Result<Cart>
Set billing address
Source§fn set_shipping(&self, id: CartId, shipping: SetCartShipping) -> Result<Cart>
fn set_shipping(&self, id: CartId, shipping: SetCartShipping) -> Result<Cart>
Set shipping method
Source§fn get_shipping_rates(&self, _id: CartId) -> Result<Vec<ShippingRate>>
fn get_shipping_rates(&self, _id: CartId) -> Result<Vec<ShippingRate>>
Get available shipping rates for cart
Source§fn set_payment(&self, id: CartId, payment: SetCartPayment) -> Result<Cart>
fn set_payment(&self, id: CartId, payment: SetCartPayment) -> Result<Cart>
Set payment method/token
Source§fn set_x402_payment(
&self,
id: CartId,
payment: SetCartX402Payment,
) -> Result<Cart>
fn set_x402_payment( &self, id: CartId, payment: SetCartX402Payment, ) -> Result<Cart>
Set x402 payment method (stablecoin)
Source§fn complete_with_x402(
&self,
id: CartId,
payee_address: &str,
) -> Result<X402CheckoutResult>
fn complete_with_x402( &self, id: CartId, payee_address: &str, ) -> Result<X402CheckoutResult>
Complete checkout with x402 payment
Returns
PaymentRequired if no intent exists, IntentCreated if awaiting signature,
AwaitingSettlement if signed but not settled, or Completed if settledSource§fn apply_discount(&self, id: CartId, coupon_code: &str) -> Result<Cart>
fn apply_discount(&self, id: CartId, coupon_code: &str) -> Result<Cart>
Apply coupon/discount code
Source§fn mark_ready_for_payment(&self, id: CartId) -> Result<Cart>
fn mark_ready_for_payment(&self, id: CartId) -> Result<Cart>
Mark cart as ready for payment (validates all requirements met)
Source§fn complete(&self, id: CartId) -> Result<CheckoutResult>
fn complete(&self, id: CartId) -> Result<CheckoutResult>
Complete checkout (creates order, returns checkout result). Read more
Source§fn complete_settled_externally(&self, id: CartId) -> Result<CheckoutResult>
fn complete_settled_externally(&self, id: CartId) -> Result<CheckoutResult>
Complete checkout for a cart whose payment was settled outside the
engine (ACP, external PSP). Explicitly opts in to minting an order that
is
Confirmed + Paid with no engine-side payment record.Source§fn create_batch(&self, inputs: Vec<CreateCart>) -> Result<BatchResult<Cart>>
fn create_batch(&self, inputs: Vec<CreateCart>) -> Result<BatchResult<Cart>>
Create multiple carts - partial success allowed
Source§fn create_batch_atomic(&self, inputs: Vec<CreateCart>) -> Result<Vec<Cart>>
fn create_batch_atomic(&self, inputs: Vec<CreateCart>) -> Result<Vec<Cart>>
Create multiple carts - atomic (all-or-nothing)
Source§fn update_batch(
&self,
updates: Vec<(CartId, UpdateCart)>,
) -> Result<BatchResult<Cart>>
fn update_batch( &self, updates: Vec<(CartId, UpdateCart)>, ) -> Result<BatchResult<Cart>>
Update multiple carts - partial success allowed
Source§fn update_batch_atomic(
&self,
updates: Vec<(CartId, UpdateCart)>,
) -> Result<Vec<Cart>>
fn update_batch_atomic( &self, updates: Vec<(CartId, UpdateCart)>, ) -> Result<Vec<Cart>>
Update multiple carts - atomic (all-or-nothing)
Source§fn delete_batch(&self, ids: Vec<CartId>) -> Result<BatchResult<CartId>>
fn delete_batch(&self, ids: Vec<CartId>) -> Result<BatchResult<CartId>>
Delete multiple carts - partial success allowed
Auto Trait Implementations§
impl !RefUnwindSafe for SqliteCartRepository
impl !UnwindSafe for SqliteCartRepository
impl Freeze for SqliteCartRepository
impl Send for SqliteCartRepository
impl Sync for SqliteCartRepository
impl Unpin for SqliteCartRepository
impl UnsafeUnpin for SqliteCartRepository
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