Struct raiden_blockchain::proxies::ProxyManager
source · pub struct ProxyManager {
pub tokens: RwLock<HashMap<Address, TokenProxy<Http>>>,
pub token_networks: RwLock<HashMap<Address, TokenNetworkProxy<Http>>>,
pub token_network_registries: RwLock<HashMap<Address, TokenNetworkRegistryProxy<Http>>>,
pub secret_registries: RwLock<HashMap<Address, SecretRegistryProxy<Http>>>,
pub service_registries: RwLock<HashMap<Address, ServiceRegistryProxy<Http>>>,
pub user_deposit: RwLock<HashMap<Address, UserDeposit<Http>>>,
/* private fields */
}
Expand description
The proxy singleton manager.
Makes sure that every proxy to a specific contract address has one and only one instance.
Fields§
§tokens: RwLock<HashMap<Address, TokenProxy<Http>>>
§token_networks: RwLock<HashMap<Address, TokenNetworkProxy<Http>>>
§token_network_registries: RwLock<HashMap<Address, TokenNetworkRegistryProxy<Http>>>
§secret_registries: RwLock<HashMap<Address, SecretRegistryProxy<Http>>>
§service_registries: RwLock<HashMap<Address, ServiceRegistryProxy<Http>>>
§user_deposit: RwLock<HashMap<Address, UserDeposit<Http>>>
Implementations§
source§impl ProxyManager
impl ProxyManager
sourcepub fn new(
web3: Web3<Http>,
contracts_manager: Arc<ContractsManager>
) -> Result<Self, ProxyError>
pub fn new( web3: Web3<Http>, contracts_manager: Arc<ContractsManager> ) -> Result<Self, ProxyError>
Returns a new instance of ProxyManager
.
sourcepub fn gas_metadata(&self) -> Arc<GasMetadata>
pub fn gas_metadata(&self) -> Arc<GasMetadata>
Returns gas metadata.
sourcepub async fn token_network_registry(
&self,
token_network_registry_address: TokenNetworkRegistryAddress
) -> Result<TokenNetworkRegistryProxy<Http>, ContractDefError>
pub async fn token_network_registry( &self, token_network_registry_address: TokenNetworkRegistryAddress ) -> Result<TokenNetworkRegistryProxy<Http>, ContractDefError>
Creates and returns the proxy for the token network registry.
sourcepub async fn secret_registry(
&self,
secret_registry_address: SecretRegistryAddress
) -> Result<SecretRegistryProxy<Http>, ContractDefError>
pub async fn secret_registry( &self, secret_registry_address: SecretRegistryAddress ) -> Result<SecretRegistryProxy<Http>, ContractDefError>
Creates and returns the proxy for the secret registry.
sourcepub async fn service_registry(
&self,
service_registry_address: Address
) -> Result<ServiceRegistryProxy<Http>, ContractDefError>
pub async fn service_registry( &self, service_registry_address: Address ) -> Result<ServiceRegistryProxy<Http>, ContractDefError>
Creates and returns the proxy for the service registry.
sourcepub async fn user_deposit(
&self,
user_deposit_address: Address
) -> Result<UserDeposit<Http>, ContractDefError>
pub async fn user_deposit( &self, user_deposit_address: Address ) -> Result<UserDeposit<Http>, ContractDefError>
Creates and returns the proxy for the user deposit contract.
sourcepub async fn token(
&self,
token_address: TokenAddress
) -> Result<TokenProxy<Http>, ContractDefError>
pub async fn token( &self, token_address: TokenAddress ) -> Result<TokenProxy<Http>, ContractDefError>
Creates and returns the proxy for the token contract.
sourcepub async fn token_network(
&self,
token_address: TokenAddress,
token_network_address: TokenNetworkAddress
) -> Result<TokenNetworkProxy<Http>, ContractDefError>
pub async fn token_network( &self, token_address: TokenAddress, token_network_address: TokenNetworkAddress ) -> Result<TokenNetworkProxy<Http>, ContractDefError>
Creates and returns the proxy for the token network contract.
sourcepub async fn payment_channel(
&self,
channel_state: &ChannelState
) -> Result<ChannelProxy<Http>, ContractDefError>
pub async fn payment_channel( &self, channel_state: &ChannelState ) -> Result<ChannelProxy<Http>, ContractDefError>
Creates and returns the proxy for the channel proxy.
Auto Trait Implementations§
impl !Freeze for ProxyManager
impl !RefUnwindSafe for ProxyManager
impl Send for ProxyManager
impl Sync for ProxyManager
impl Unpin for ProxyManager
impl !UnwindSafe for ProxyManager
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> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.