pub struct MarketHeader {
pub discriminant: u64,
pub status: u64,
pub market_size_params: MarketSizeParams,
pub base_params: TokenParams,
pub quote_params: TokenParams,
pub authority: Pubkey,
pub fee_recipient: Pubkey,
pub market_sequence_number: u64,
pub successor: Pubkey,
pub raw_base_units_per_base_unit: u32,
/* private fields */
}
Fields§
§discriminant: u64
§status: u64
§market_size_params: MarketSizeParams
§base_params: TokenParams
§quote_params: TokenParams
§fee_recipient: Pubkey
§market_sequence_number: u64
§successor: Pubkey
§raw_base_units_per_base_unit: u32
Implementations§
Source§impl MarketHeader
impl MarketHeader
pub fn new( market_size_params: MarketSizeParams, base_params: TokenParams, base_lot_size: BaseAtomsPerBaseLot, quote_params: TokenParams, quote_lot_size: QuoteAtomsPerQuoteLot, tick_size_in_quote_atoms_per_base_unit: QuoteAtomsPerBaseUnitPerTick, authority: Pubkey, successor: Pubkey, fee_recipient: Pubkey, raw_base_units_per_base_unit: u32, ) -> Self
Sourcepub fn price_in_ticks(&self, price: u64) -> u64
pub fn price_in_ticks(&self, price: u64) -> u64
Converts a price from quote atoms per base unit to ticks.
pub fn get_base_lot_size(&self) -> BaseAtomsPerBaseLot
pub fn get_quote_lot_size(&self) -> QuoteAtomsPerQuoteLot
pub fn get_tick_size_in_quote_atoms_per_base_unit( &self, ) -> QuoteAtomsPerBaseUnitPerTick
pub fn increment_sequence_number(&mut self)
Trait Implementations§
Source§impl Clone for MarketHeader
impl Clone for MarketHeader
Source§fn clone(&self) -> MarketHeader
fn clone(&self) -> MarketHeader
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 moreSource§impl Debug for MarketHeader
impl Debug for MarketHeader
Source§impl ZeroCopy for MarketHeader
impl ZeroCopy for MarketHeader
fn load_mut_bytes(data: &mut [u8]) -> Option<&mut Self>
fn load_bytes(data: &[u8]) -> Option<&Self>
impl Copy for MarketHeader
impl Pod for MarketHeader
Auto Trait Implementations§
impl Freeze for MarketHeader
impl RefUnwindSafe for MarketHeader
impl Send for MarketHeader
impl Sync for MarketHeader
impl Unpin for MarketHeader
impl UnwindSafe for MarketHeader
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> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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