[−][src]Struct interledger_store_redis::RedisStore
A Store that uses Redis as its underlying database.
This store leverages atomic Redis transactions to do operations such as balance updates.
Currently the RedisStore polls the database for the routing table and rate updates, but future versions of it will use PubSub to subscribe to updates.
Fields
ilp_address: Arc<RwLock<Address>>
Methods
impl RedisStore
[src]
Trait Implementations
impl Clone for RedisStore
[src]
fn clone(&self) -> RedisStore
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl NodeStore for RedisStore
[src]
type Account = Account
fn insert_account(
&self,
account: AccountDetails
) -> Box<dyn Future<Item = Account, Error = ()> + Send>
[src]
&self,
account: AccountDetails
) -> Box<dyn Future<Item = Account, Error = ()> + Send>
fn delete_account(
&self,
id: AccountId
) -> Box<dyn Future<Item = Account, Error = ()> + Send>
[src]
&self,
id: AccountId
) -> Box<dyn Future<Item = Account, Error = ()> + Send>
fn update_account(
&self,
id: AccountId,
account: AccountDetails
) -> Box<dyn Future<Item = Self::Account, Error = ()> + Send>
[src]
&self,
id: AccountId,
account: AccountDetails
) -> Box<dyn Future<Item = Self::Account, Error = ()> + Send>
fn modify_account_settings(
&self,
id: <Self::Account as AccountTrait>::AccountId,
settings: AccountSettings
) -> Box<dyn Future<Item = Self::Account, Error = ()> + Send>
[src]
&self,
id: <Self::Account as AccountTrait>::AccountId,
settings: AccountSettings
) -> Box<dyn Future<Item = Self::Account, Error = ()> + Send>
fn get_all_accounts(
&self
) -> Box<dyn Future<Item = Vec<Self::Account>, Error = ()> + Send>
[src]
&self
) -> Box<dyn Future<Item = Vec<Self::Account>, Error = ()> + Send>
fn set_static_routes<R>(
&self,
routes: R
) -> Box<dyn Future<Item = (), Error = ()> + Send> where
R: IntoIterator<Item = (String, AccountId)>,
[src]
&self,
routes: R
) -> Box<dyn Future<Item = (), Error = ()> + Send> where
R: IntoIterator<Item = (String, AccountId)>,
fn set_static_route(
&self,
prefix: String,
account_id: AccountId
) -> Box<dyn Future<Item = (), Error = ()> + Send>
[src]
&self,
prefix: String,
account_id: AccountId
) -> Box<dyn Future<Item = (), Error = ()> + Send>
fn set_default_route(
&self,
account_id: AccountId
) -> Box<dyn Future<Item = (), Error = ()> + Send>
[src]
&self,
account_id: AccountId
) -> Box<dyn Future<Item = (), Error = ()> + Send>
fn set_settlement_engines(
&self,
asset_to_url_map: impl IntoIterator<Item = (String, Url)>
) -> Box<dyn Future<Item = (), Error = ()> + Send>
[src]
&self,
asset_to_url_map: impl IntoIterator<Item = (String, Url)>
) -> Box<dyn Future<Item = (), Error = ()> + Send>
fn get_asset_settlement_engine(
&self,
asset_code: &str
) -> Box<dyn Future<Item = Option<Url>, Error = ()> + Send>
[src]
&self,
asset_code: &str
) -> Box<dyn Future<Item = Option<Url>, Error = ()> + Send>
impl HttpStore for RedisStore
[src]
type Account = Account
fn get_account_from_http_auth(
&self,
username: &Username,
token: &str
) -> Box<dyn Future<Item = Self::Account, Error = ()> + Send>
[src]
&self,
username: &Username,
token: &str
) -> Box<dyn Future<Item = Self::Account, Error = ()> + Send>
Checks if the stored token for the provided account id matches the provided token, and if so, returns the account associated with that token
impl RouterStore for RedisStore
[src]
fn routing_table(
&self
) -> Arc<HashMap<String, <Self::Account as AccountTrait>::AccountId>>
[src]
&self
) -> Arc<HashMap<String, <Self::Account as AccountTrait>::AccountId>>
impl AddressStore for RedisStore
[src]
fn set_ilp_address(
&self,
ilp_address: Address
) -> Box<dyn Future<Item = (), Error = ()> + Send>
[src]
&self,
ilp_address: Address
) -> Box<dyn Future<Item = (), Error = ()> + Send>
fn clear_ilp_address(&self) -> Box<dyn Future<Item = (), Error = ()> + Send>
[src]
fn get_ilp_address(&self) -> Address
[src]
impl BalanceStore for RedisStore
[src]
fn get_balance(
&self,
account: Account
) -> Box<dyn Future<Item = i64, Error = ()> + Send>
[src]
&self,
account: Account
) -> Box<dyn Future<Item = i64, Error = ()> + Send>
Returns the balance from the account holder's perspective, meaning the sum of the Payable Balance and Pending Outgoing minus the Receivable Balance and the Pending Incoming.
fn update_balances_for_prepare(
&self,
from_account: Account,
incoming_amount: u64
) -> Box<dyn Future<Item = (), Error = ()> + Send>
[src]
&self,
from_account: Account,
incoming_amount: u64
) -> Box<dyn Future<Item = (), Error = ()> + Send>
fn update_balances_for_fulfill(
&self,
to_account: Account,
outgoing_amount: u64
) -> Box<dyn Future<Item = (i64, u64), Error = ()> + Send>
[src]
&self,
to_account: Account,
outgoing_amount: u64
) -> Box<dyn Future<Item = (i64, u64), Error = ()> + Send>
fn update_balances_for_reject(
&self,
from_account: Account,
incoming_amount: u64
) -> Box<dyn Future<Item = (), Error = ()> + Send>
[src]
&self,
from_account: Account,
incoming_amount: u64
) -> Box<dyn Future<Item = (), Error = ()> + Send>
impl ExchangeRateStore for RedisStore
[src]
fn get_exchange_rates(&self, asset_codes: &[&str]) -> Result<Vec<f64>, ()>
[src]
fn get_all_exchange_rates(&self) -> Result<HashMap<String, f64>, ()>
[src]
fn set_exchange_rates(&self, rates: HashMap<String, f64>) -> Result<(), ()>
[src]
impl StreamNotificationsStore for RedisStore
[src]
type Account = Account
fn add_payment_notification_subscription(
&self,
id: AccountId,
sender: UnboundedSender<PaymentNotification>
)
[src]
&self,
id: AccountId,
sender: UnboundedSender<PaymentNotification>
)
fn publish_payment_notification(&self, payment: PaymentNotification)
[src]
impl SettlementStore for RedisStore
[src]
type Account = Account
fn update_balance_for_incoming_settlement(
&self,
account_id: AccountId,
amount: u64,
idempotency_key: Option<String>
) -> Box<dyn Future<Item = (), Error = ()> + Send>
[src]
&self,
account_id: AccountId,
amount: u64,
idempotency_key: Option<String>
) -> Box<dyn Future<Item = (), Error = ()> + Send>
fn refund_settlement(
&self,
account_id: AccountId,
settle_amount: u64
) -> Box<dyn Future<Item = (), Error = ()> + Send>
[src]
&self,
account_id: AccountId,
settle_amount: u64
) -> Box<dyn Future<Item = (), Error = ()> + Send>
impl AccountStore for RedisStore
[src]
type Account = Account
fn get_accounts(
&self,
account_ids: Vec<<Self::Account as AccountTrait>::AccountId>
) -> Box<dyn Future<Item = Vec<Account>, Error = ()> + Send>
[src]
&self,
account_ids: Vec<<Self::Account as AccountTrait>::AccountId>
) -> Box<dyn Future<Item = Vec<Account>, Error = ()> + Send>
fn get_account_id_from_username(
&self,
username: &Username
) -> Box<dyn Future<Item = AccountId, Error = ()> + Send>
[src]
&self,
username: &Username
) -> Box<dyn Future<Item = AccountId, Error = ()> + Send>
impl IdempotentStore for RedisStore
[src]
fn load_idempotent_data(
&self,
idempotency_key: String
) -> Box<dyn Future<Item = Option<IdempotentData>, Error = ()> + Send>
[src]
&self,
idempotency_key: String
) -> Box<dyn Future<Item = Option<IdempotentData>, Error = ()> + Send>
fn save_idempotent_data(
&self,
idempotency_key: String,
input_hash: [u8; 32],
status_code: StatusCode,
data: Bytes
) -> Box<dyn Future<Item = (), Error = ()> + Send>
[src]
&self,
idempotency_key: String,
input_hash: [u8; 32],
status_code: StatusCode,
data: Bytes
) -> Box<dyn Future<Item = (), Error = ()> + Send>
impl RateLimitStore for RedisStore
[src]
type Account = Account
fn apply_rate_limits(
&self,
account: Account,
prepare_amount: u64
) -> Box<dyn Future<Item = (), Error = RateLimitError> + Send>
[src]
&self,
account: Account,
prepare_amount: u64
) -> Box<dyn Future<Item = (), Error = RateLimitError> + Send>
Apply rate limits for number of packets per minute and amount of money per minute
This uses https://github.com/brandur/redis-cell so the redis-cell module MUST be loaded into redis before this is run
fn refund_throughput_limit(
&self,
account: Account,
prepare_amount: u64
) -> Box<dyn Future<Item = (), Error = ()> + Send>
[src]
&self,
account: Account,
prepare_amount: u64
) -> Box<dyn Future<Item = (), Error = ()> + Send>
impl LeftoversStore for RedisStore
[src]
type AccountId = AccountId
type AssetType = BigUint
fn get_uncredited_settlement_amount(
&self,
account_id: Self::AccountId
) -> Box<dyn Future<Item = (Self::AssetType, u8), Error = ()> + Send>
[src]
&self,
account_id: Self::AccountId
) -> Box<dyn Future<Item = (Self::AssetType, u8), Error = ()> + Send>
fn save_uncredited_settlement_amount(
&self,
account_id: Self::AccountId,
uncredited_settlement_amount: (Self::AssetType, u8)
) -> Box<dyn Future<Item = (), Error = ()> + Send>
[src]
&self,
account_id: Self::AccountId,
uncredited_settlement_amount: (Self::AssetType, u8)
) -> Box<dyn Future<Item = (), Error = ()> + Send>
fn load_uncredited_settlement_amount(
&self,
account_id: Self::AccountId,
local_scale: u8
) -> Box<dyn Future<Item = Self::AssetType, Error = ()> + Send>
[src]
&self,
account_id: Self::AccountId,
local_scale: u8
) -> Box<dyn Future<Item = Self::AssetType, Error = ()> + Send>
impl BtpStore for RedisStore
[src]
type Account = Account
fn get_account_from_btp_auth(
&self,
username: &Username,
token: &str
) -> Box<dyn Future<Item = Self::Account, Error = ()> + Send>
[src]
&self,
username: &Username,
token: &str
) -> Box<dyn Future<Item = Self::Account, Error = ()> + Send>
fn get_btp_outgoing_accounts(
&self
) -> Box<dyn Future<Item = Vec<Self::Account>, Error = ()> + Send>
[src]
&self
) -> Box<dyn Future<Item = Vec<Self::Account>, Error = ()> + Send>
impl RouteManagerStore for RedisStore
[src]
type Account = Account
fn get_accounts_to_send_routes_to(
&self,
ignore_accounts: Vec<AccountId>
) -> Box<dyn Future<Item = Vec<Account>, Error = ()> + Send>
[src]
&self,
ignore_accounts: Vec<AccountId>
) -> Box<dyn Future<Item = Vec<Account>, Error = ()> + Send>
fn get_accounts_to_receive_routes_from(
&self
) -> Box<dyn Future<Item = Vec<Account>, Error = ()> + Send>
[src]
&self
) -> Box<dyn Future<Item = Vec<Account>, Error = ()> + Send>
fn get_local_and_configured_routes(
&self
) -> Box<dyn Future<Item = (HashMap<String, Account>, HashMap<String, Account>), Error = ()> + Send>
[src]
&self
) -> Box<dyn Future<Item = (HashMap<String, Account>, HashMap<String, Account>), Error = ()> + Send>
fn set_routes(
&mut self,
routes: impl IntoIterator<Item = (String, Account)>
) -> Box<dyn Future<Item = (), Error = ()> + Send>
[src]
&mut self,
routes: impl IntoIterator<Item = (String, Account)>
) -> Box<dyn Future<Item = (), Error = ()> + Send>
Auto Trait Implementations
impl Send for RedisStore
impl Sync for RedisStore
impl Unpin for RedisStore
impl !UnwindSafe for RedisStore
impl !RefUnwindSafe for RedisStore
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,