Struct levana_perpswap_cosmos::price::PriceKey
source · pub struct PriceKey(/* private fields */);
Expand description
A modified version of a Price used as a key in a Map
.
Due to how cw-storage-plus works, we need to have a reference to a slice,
which we can’t get from a Decimal256
. Instead, we store an array directly
here and provide conversion functions.
Trait Implementations§
source§impl<'a> PrimaryKey<'a> for PriceKey
impl<'a> PrimaryKey<'a> for PriceKey
§type Prefix = ()
type Prefix = ()
These associated types need to implement
Prefixer
, so that they can be useful arguments
for prefix()
, sub_prefix()
, and their key-deserializable variants.type SubPrefix = ()
§type Suffix = PriceKey
type Suffix = PriceKey
These associated types need to implement
KeyDeserialize
, so that they can be returned from
range_de()
and friends.type SuperSuffix = PriceKey
fn joined_key(&self) -> Vec<u8>
fn joined_extra_key(&self, key: &[u8]) -> Vec<u8>
Auto Trait Implementations§
impl Freeze for PriceKey
impl RefUnwindSafe for PriceKey
impl Send for PriceKey
impl Sync for PriceKey
impl Unpin for PriceKey
impl UnwindSafe for PriceKey
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
Casts
self
to type T
. The semantics of numeric casting with the as
operator are followed, so <T as As>::as_::<U>
can be used in the same way as T as U
for numeric conversions. Read moresource§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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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