pub struct Inventory { /* private fields */ }Expand description
Inventory manager tracking stock in bins
Implementations§
Source§impl Inventory
impl Inventory
pub fn new() -> Self
Sourcepub fn register_bin(&mut self, address: BinAddress)
pub fn register_bin(&mut self, address: BinAddress)
Register a bin address as available for inventory
Sourcepub fn set_replen_threshold(&mut self, sku_id: SkuId, threshold: u32)
pub fn set_replen_threshold(&mut self, sku_id: SkuId, threshold: u32)
Set replenishment threshold for a SKU
Sourcepub fn get_replen_threshold(&self, sku_id: SkuId) -> Option<u32>
pub fn get_replen_threshold(&self, sku_id: SkuId) -> Option<u32>
Get replenishment threshold for a SKU
pub fn add_placement( &mut self, address: BinAddress, sku_id: SkuId, quantity: u32, )
pub fn get_slot(&self, address: &BinAddress) -> Option<&InventorySlot>
pub fn get_quantity(&self, address: &BinAddress) -> Option<u32>
pub fn find_sku(&self, sku_id: SkuId) -> impl Iterator<Item = &BinAddress>
pub fn find_sku_with_stock( &self, sku_id: SkuId, min_qty: u32, ) -> Option<&BinAddress>
pub fn decrement( &mut self, address: &BinAddress, qty: u32, ) -> Result<(), InventoryError>
pub fn increment( &mut self, address: &BinAddress, qty: u32, ) -> Result<(), InventoryError>
pub fn total_quantity(&self, sku_id: SkuId) -> u32
Sourcepub fn get_empty_bins(&self) -> Vec<&BinAddress>
pub fn get_empty_bins(&self) -> Vec<&BinAddress>
Get all bins that are empty (no inventory or zero quantity)
Sourcepub fn all_bins(&self) -> &[BinAddress]
pub fn all_bins(&self) -> &[BinAddress]
Get all registered bins
Sourcepub fn needs_replenishment(
&self,
sku_id: SkuId,
) -> Option<(BinAddress, u32, u32)>
pub fn needs_replenishment( &self, sku_id: SkuId, ) -> Option<(BinAddress, u32, u32)>
Check if a SKU needs replenishment (below threshold)
Sourcepub fn get_replenishment_needed(&self) -> Vec<(SkuId, BinAddress, u32, u32)>
pub fn get_replenishment_needed(&self) -> Vec<(SkuId, BinAddress, u32, u32)>
Get all SKUs that need replenishment
Sourcepub fn create_empty_slot(&mut self, address: BinAddress, sku_id: SkuId)
pub fn create_empty_slot(&mut self, address: BinAddress, sku_id: SkuId)
Create a new empty bin slot (for putaway destination)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Inventory
impl RefUnwindSafe for Inventory
impl Send for Inventory
impl Sync for Inventory
impl Unpin for Inventory
impl UnwindSafe for Inventory
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.