Struct jet_margin::PriceInfo
source · [−]#[repr(C)]pub struct PriceInfo {
pub value: i64,
pub timestamp: u64,
pub exponent: i32,
pub is_valid: u8,
pub _reserved: [u8; 3],
}
Fields
value: i64
The current price
timestamp: u64
The timestamp the price was valid at
exponent: i32
The exponent for the price value
is_valid: u8
Flag indicating if the price is valid for the position
_reserved: [u8; 3]
Implementations
Trait Implementations
sourceimpl BorshDeserialize for PriceInfowhere
i64: BorshDeserialize,
u64: BorshDeserialize,
i32: BorshDeserialize,
u8: BorshDeserialize,
[u8; 3]: BorshDeserialize,
impl BorshDeserialize for PriceInfowhere
i64: BorshDeserialize,
u64: BorshDeserialize,
i32: BorshDeserialize,
u8: BorshDeserialize,
[u8; 3]: BorshDeserialize,
sourcefn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes. Read more
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
sourceimpl BorshSerialize for PriceInfowhere
i64: BorshSerialize,
u64: BorshSerialize,
i32: BorshSerialize,
u8: BorshSerialize,
[u8; 3]: BorshSerialize,
impl BorshSerialize for PriceInfowhere
i64: BorshSerialize,
u64: BorshSerialize,
i32: BorshSerialize,
u8: BorshSerialize,
[u8; 3]: BorshSerialize,
sourceimpl TryFrom<PriceChangeInfo> for PriceInfo
impl TryFrom<PriceChangeInfo> for PriceInfo
type Error = Error
type Error = Error
The type returned in the event of a conversion error.
sourcefn try_from(value: PriceChangeInfo) -> AnchorResult<Self>
fn try_from(value: PriceChangeInfo) -> AnchorResult<Self>
Performs the conversion.
impl Copy for PriceInfo
impl Eq for PriceInfo
impl Pod for PriceInfo
impl StructuralEq for PriceInfo
impl StructuralPartialEq for PriceInfo
Auto Trait Implementations
impl RefUnwindSafe for PriceInfo
impl Send for PriceInfo
impl Sync for PriceInfo
impl Unpin for PriceInfo
impl UnwindSafe for PriceInfo
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
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
. Read more