pub struct Listing {
pub id: u64,
pub seller_id: String,
pub item_id: String,
pub quantity: u32,
pub quality: u8,
pub buyout_price: Option<Currency>,
pub min_bid: Currency,
pub expires_at: f32,
pub resolved: bool,
}Expand description
An item posted for sale or auction on the AuctionHouse.
Fields§
§id: u64§seller_id: String§item_id: String§quantity: u32§quality: u8Quality byte (0–255) of the item being sold.
buyout_price: Option<Currency>Optional instant-buyout price (None means auction-only).
min_bid: CurrencyStarting minimum bid for the auction.
expires_at: f32Game time at which this listing expires.
resolved: boolWhether this listing has been resolved (sold / expired).
Implementations§
Source§impl Listing
impl Listing
pub fn new( id: u64, seller_id: impl Into<String>, item_id: impl Into<String>, quantity: u32, quality: u8, buyout_price: Option<Currency>, min_bid: Currency, expires_at: f32, ) -> Self
pub fn is_expired(&self, current_time: f32) -> bool
pub fn is_active(&self, current_time: f32) -> bool
Sourcepub fn has_buyout(&self) -> bool
pub fn has_buyout(&self) -> bool
Whether the listing has a buyout option.
Sourcepub fn time_remaining(&self, current_time: f32) -> f32
pub fn time_remaining(&self, current_time: f32) -> f32
Duration remaining in seconds.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Listing
impl RefUnwindSafe for Listing
impl Send for Listing
impl Sync for Listing
impl Unpin for Listing
impl UnsafeUnpin for Listing
impl UnwindSafe for Listing
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.