pub struct RedisKey(/* private fields */);Expand description
A typed Redis key with factory methods for all Pyra key patterns.
Implementations§
Source§impl RedisKey
impl RedisKey
pub const DRIFT_USER_PREFIX: &'static str = "account:drift:user"
pub const DRIFT_USER_BY_PUBKEY_PREFIX: &'static str = "reverse:drift_user_pubkey"
pub const DRIFT_SPOT_MARKET_PREFIX: &'static str = "account:drift:spot_market"
pub fn drift_user(authority: &Pubkey) -> Self
Sourcepub fn drift_user_by_pubkey(pubkey: &Pubkey) -> Self
pub fn drift_user_by_pubkey(pubkey: &Pubkey) -> Self
Reverse mapping: DriftUser account pubkey → authority (vault pubkey).
pub fn drift_spot_market(asset_id: AssetId) -> Self
Source§impl RedisKey
impl RedisKey
pub const KAMINO_OBLIGATION_PREFIX: &'static str = "account:kamino:obligation"
pub const KAMINO_OBLIGATION_BY_PUBKEY_PREFIX: &'static str = "reverse:kamino_obligation_pubkey"
pub const KAMINO_RESERVE_PREFIX: &'static str = "account:kamino:reserve"
pub fn kamino_obligation( vault_address: &Pubkey, lending_market: &Pubkey, ) -> Self
Sourcepub fn kamino_obligation_by_pubkey(obligation_pubkey: &Pubkey) -> Self
pub fn kamino_obligation_by_pubkey(obligation_pubkey: &Pubkey) -> Self
Reverse mapping: Kamino Obligation account pubkey → vault authority.
pub fn kamino_reserve(reserve_pubkey: &Pubkey) -> Self
pub fn kamino_obligation_glob() -> String
pub fn kamino_reserve_glob() -> String
Source§impl RedisKey
impl RedisKey
pub const VAULT_PREFIX: &'static str = "account:pyra:vault"
pub const WITHDRAW_ORDER_PREFIX: &'static str = "account:pyra:withdraw_order"
pub const SPEND_LIMITS_ORDER_PREFIX: &'static str = "account:pyra:spend_limits_order"
pub const DEPOSIT_ADDRESS_PREFIX: &'static str = "account:pyra:deposit_address"
pub const DEPOSIT_ADDRESS_OWNER_PREFIX: &'static str = "reverse:deposit_address"
pub const USER_WITHDRAW_ORDERS_PREFIX: &'static str = "user:orders:withdraws"
pub const USER_SPEND_LIMITS_ORDERS_PREFIX: &'static str = "user:orders:spend_limits"
pub const TOKEN_ACCOUNT_PREFIX: &'static str = "account:token"
pub const PRICE_PREFIX: &'static str = "price"
pub const ORACLE_PREFIX: &'static str = "oracle"
pub const ORACLE_CACHE_PREFIX: &'static str = "account:oracle"
pub const REGISTERED_WALLETS: &'static str = "registered_wallets"
pub const REGISTERED_WALLETS_CHANGES: &'static str = "registered_wallets:changes"
pub const USER_SOLANA_ADDRESS_PREFIX: &'static str = "user:solana_address"
pub const USER_PROVIDER_PREFIX: &'static str = "user:provider"
pub const PENDING_DEPOSIT_PREFIX: &'static str = "pending_deposits"
Sourcepub fn from_string(s: String) -> Self
pub fn from_string(s: String) -> Self
Create a key from a raw string.
pub fn vault(vault: &Pubkey) -> Self
pub fn deposit_address_spl(deposit_address: &Pubkey, mint: &Pubkey) -> Self
pub fn deposit_address_sol(deposit_address: &Pubkey) -> Self
Sourcepub fn deposit_address_owner(deposit_address: &Pubkey) -> Self
pub fn deposit_address_owner(deposit_address: &Pubkey) -> Self
Reverse mapping: deposit address → owner pubkey.
pub fn withdraw_order(order: &Pubkey) -> Self
pub fn user_withdraw_orders(owner: &Pubkey) -> Self
pub fn spend_limits_order(order: &Pubkey) -> Self
pub fn user_spend_limits_orders(owner: &Pubkey) -> Self
pub fn token_account(token_account: &Pubkey) -> Self
pub fn price(asset_id: AssetId) -> Self
Sourcepub fn oracle_cache(asset_id: AssetId) -> Self
pub fn oracle_cache(asset_id: AssetId) -> Self
Full oracle snapshot cache by asset ID.
pub fn registered_wallets() -> Self
Sourcepub fn user_solana_address(owner: &str) -> Self
pub fn user_solana_address(owner: &str) -> Self
Lookup user by Solana address: "user:solana_address:{owner}".
Sourcepub fn user_provider(user_id: &str) -> Self
pub fn user_provider(user_id: &str) -> Self
Lookup user by provider (Privy) ID: "user:provider:{user_id}".
Sourcepub fn pending_deposit(owner: &str, mint: &str) -> Self
pub fn pending_deposit(owner: &str, mint: &str) -> Self
Pending deposit key: "pending_deposits:{owner}:{mint}".
Trait Implementations§
Source§impl ToRedisArgs for RedisKey
impl ToRedisArgs for RedisKey
Source§fn write_redis_args<W: ?Sized + RedisWrite>(&self, out: &mut W)
fn write_redis_args<W: ?Sized + RedisWrite>(&self, out: &mut W)
This writes the value into a vector of bytes. Each item
is a single argument. Most items generate a single item. Read more
Source§fn to_redis_args(&self) -> Vec<Vec<u8>>
fn to_redis_args(&self) -> Vec<Vec<u8>>
This converts the value into a vector of bytes. Each item
is a single argument. Most items generate a vector of a
single item. Read more
Source§fn describe_numeric_behavior(&self) -> NumericBehavior
fn describe_numeric_behavior(&self) -> NumericBehavior
Returns an information about the contained value with regards
to it’s numeric behavior in a redis context. This is used in
some high level concepts to switch between different implementations
of redis functions (for instance
INCR vs INCRBYFLOAT).Source§fn num_of_args(&self) -> usize
fn num_of_args(&self) -> usize
Returns the number of arguments this value will generate. Read more
impl Eq for RedisKey
impl StructuralPartialEq for RedisKey
Auto Trait Implementations§
impl Freeze for RedisKey
impl RefUnwindSafe for RedisKey
impl Send for RedisKey
impl Sync for RedisKey
impl Unpin for RedisKey
impl UnsafeUnpin for RedisKey
impl UnwindSafe for RedisKey
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