CreateOrder

Struct CreateOrder 

Source
pub struct CreateOrder {
    pub item_id: String,
    pub order_type: OrderType,
    pub platinum: u32,
    pub quantity: u32,
    pub visible: bool,
    pub per_trade: Option<u32>,
    pub rank: Option<u8>,
    pub charges: Option<u8>,
    pub subtype: Option<String>,
    pub amber_stars: Option<u8>,
    pub cyan_stars: Option<u8>,
}
Expand description

Request to create a new order.

Use the builder methods to construct orders with proper validation.

§Example

use wf_market::{CreateOrder, OrderType};

// Simple sell order
let order = CreateOrder::sell("nikana_prime_set", 100, 1);

// Mod order with rank
let mod_order = CreateOrder::sell("serration", 50, 1)
    .with_mod_rank(10);

// Hidden order
let hidden = CreateOrder::buy("mesa_prime_set", 200, 1)
    .hidden();

// Sculpture with stars
let sculpture = CreateOrder::sell("ayatan_anasa_sculpture", 25, 1)
    .with_sculpture_stars(2, 4);

Fields§

§item_id: String

ID of the item to trade

§order_type: OrderType

Order type (buy or sell)

§platinum: u32

Price in platinum

§quantity: u32

Quantity to trade

§visible: bool

Whether the order is visible

§per_trade: Option<u32>

Minimum items per trade

§rank: Option<u8>

Mod rank (for rankable mods)

§charges: Option<u8>

Charges remaining (for consumable mods)

§subtype: Option<String>

Item subtype (e.g., blueprint, crafted)

§amber_stars: Option<u8>

Amber stars installed (for sculptures)

§cyan_stars: Option<u8>

Cyan stars installed (for sculptures)

Implementations§

Source§

impl CreateOrder

Source

pub fn sell(item_id: impl Into<String>, platinum: u32, quantity: u32) -> Self

Create a new sell order.

§Arguments
  • item_id - The item’s ID or slug
  • platinum - Price in platinum (must be > 0)
  • quantity - Number of items to sell (must be > 0)
§Panics

Panics in debug builds if platinum or quantity is 0.

Source

pub fn buy(item_id: impl Into<String>, platinum: u32, quantity: u32) -> Self

Create a new buy order.

§Arguments
  • item_id - The item’s ID or slug
  • platinum - Price in platinum (must be > 0)
  • quantity - Number of items to buy (must be > 0)
§Panics

Panics in debug builds if platinum or quantity is 0.

Source

pub fn with_mod_rank(self, rank: u8) -> Self

Set the mod rank (for rankable mods).

Source

pub fn with_charges(self, charges: u8) -> Self

Set the charges (for consumable mods like Requiem).

Source

pub fn with_subtype(self, subtype: impl Into<String>) -> Self

Set the item subtype (e.g., “blueprint”, “crafted”).

Source

pub fn with_sculpture_stars(self, amber: u8, cyan: u8) -> Self

Set the installed stars (for Ayatan sculptures).

Source

pub fn with_per_trade(self, per_trade: u32) -> Self

Set the minimum items per trade.

Source

pub fn hidden(self) -> Self

Make the order hidden (not visible to others).

Source

pub fn visible(self) -> Self

Make the order visible (default).

Trait Implementations§

Source§

impl Clone for CreateOrder

Source§

fn clone(&self) -> CreateOrder

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CreateOrder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Serialize for CreateOrder

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more