pub struct TychoRouterEncoderBuilder { /* private fields */ }Expand description
Builder pattern for constructing a TychoRouterEncoder with customizable options.
This struct allows setting a chain and strategy encoder before building the final encoder.
Implementations§
Source§impl TychoRouterEncoderBuilder
impl TychoRouterEncoderBuilder
pub fn new() -> Self
pub fn chain(self, chain: Chain) -> Self
pub fn swap_encoder_registry( self, swap_encoder_registry: SwapEncoderRegistry, ) -> Self
Sourcepub fn router_address(self, router_address: Bytes) -> Self
pub fn router_address(self, router_address: Bytes) -> Self
Sets the router_address manually.
If it’s not set, the default router address will be used (config/router_addresses.json)
Sourcepub fn build(self) -> Result<Box<dyn TychoEncoder>, EncodingError>
pub fn build(self) -> Result<Box<dyn TychoEncoder>, EncodingError>
Builds the TychoRouterEncoder instance using the configured chain.
Returns an error if either the chain has not been set.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TychoRouterEncoderBuilder
impl !RefUnwindSafe for TychoRouterEncoderBuilder
impl Send for TychoRouterEncoderBuilder
impl Sync for TychoRouterEncoderBuilder
impl Unpin for TychoRouterEncoderBuilder
impl UnsafeUnpin for TychoRouterEncoderBuilder
impl !UnwindSafe for TychoRouterEncoderBuilder
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> 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>
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