pub struct SwapEncoderRegistry { /* private fields */ }Expand description
Registry containing all supported SwapEncoders.
Implementations§
Source§impl SwapEncoderRegistry
impl SwapEncoderRegistry
pub fn new(chain: Chain) -> Self
Sourcepub fn new_with_defaults(chain: Chain) -> Result<Self, EncodingError>
pub fn new_with_defaults(chain: Chain) -> Result<Self, EncodingError>
Creates a new registry pre-populated with all default encoders for the given chain.
Sourcepub fn add_default_encoders(
self,
executors_addresses: Option<String>,
) -> Result<Self, EncodingError>
pub fn add_default_encoders( self, executors_addresses: Option<String>, ) -> Result<Self, EncodingError>
Populates the registry with the default SwapEncoders for the given blockchain by
parsing the executors’ addresses in the file at the given path.
Sourcepub fn register_encoder(
self,
protocol: &str,
encoder: Box<dyn SwapEncoder>,
) -> Self
pub fn register_encoder( self, protocol: &str, encoder: Box<dyn SwapEncoder>, ) -> Self
Adds an encoder to the registry, replacing any existing encoder for the same protocol.
Sourcepub fn get_encoder(
&self,
protocol_system: &str,
) -> Option<&Box<dyn SwapEncoder>>
pub fn get_encoder( &self, protocol_system: &str, ) -> Option<&Box<dyn SwapEncoder>>
Returns the encoder registered for protocol_system.
Price-level-stream protocols (pricelevelstream:{venue}) without an exact entry fall
back to the family entry registered under pricelevelstream, so a single configured
executor address serves every pAMM — including auto-detected, address-named ones.
propammfallback:{venue} resolves the same way against propammfallback.
Sourcepub fn executor_addresses(&self) -> HashMap<String, Bytes>
pub fn executor_addresses(&self) -> HashMap<String, Bytes>
The executor address of every encoder in this registry, keyed by protocol system.
Several protocol systems may share one executor address, so the returned addresses are not necessarily distinct.
Trait Implementations§
Source§impl Clone for SwapEncoderRegistry
impl Clone for SwapEncoderRegistry
Source§fn clone(&self) -> SwapEncoderRegistry
fn clone(&self) -> SwapEncoderRegistry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for SwapEncoderRegistry
impl !UnwindSafe for SwapEncoderRegistry
impl Freeze for SwapEncoderRegistry
impl Send for SwapEncoderRegistry
impl Sync for SwapEncoderRegistry
impl Unpin for SwapEncoderRegistry
impl UnsafeUnpin for SwapEncoderRegistry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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> 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> ⓘ
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> ⓘ
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