pub struct TychoStreamBuilder { /* private fields */ }Implementations§
Source§impl TychoStreamBuilder
impl TychoStreamBuilder
Sourcepub fn new(tycho_url: &str, chain: Chain) -> Self
pub fn new(tycho_url: &str, chain: Chain) -> Self
Creates a new TychoStreamBuilder with the given Tycho URL and blockchain network.
Initializes the builder with default values for block time and timeout based on the chain.
Sourcepub fn exchange(self, name: &str, filter: ComponentFilter) -> Self
pub fn exchange(self, name: &str, filter: ComponentFilter) -> Self
Adds an exchange and its corresponding filter to the Tycho client.
Sourcepub fn block_time(self, block_time: u64) -> Self
pub fn block_time(self, block_time: u64) -> Self
Sets the block time for the Tycho client.
pub fn max_missed_blocks(self, max_missed_blocks: u64) -> Self
Sourcepub fn no_state(self, no_state: bool) -> Self
pub fn no_state(self, no_state: bool) -> Self
Configures the client to exclude state updates from the stream.
Sourcepub fn auth_key(self, auth_key: Option<String>) -> Self
pub fn auth_key(self, auth_key: Option<String>) -> Self
Sets the API key for authenticating with the Tycho server.
Optionally you can set the TYCHO_AUTH_TOKEN env var instead. Make sure to set no_tsl to false if you do this.
Sourcepub fn no_tls(self, no_tls: bool) -> Self
pub fn no_tls(self, no_tls: bool) -> Self
Disables TLS/SSL for the connection, using http and ws protocols.
Sourcepub async fn build(
self,
) -> Result<(JoinHandle<()>, Receiver<FeedMessage>), StreamError>
pub async fn build( self, ) -> Result<(JoinHandle<()>, Receiver<FeedMessage>), StreamError>
Builds and starts the Tycho client, connecting to the Tycho server and setting up the synchronization of exchange components.
Auto Trait Implementations§
impl Freeze for TychoStreamBuilder
impl RefUnwindSafe for TychoStreamBuilder
impl Send for TychoStreamBuilder
impl Sync for TychoStreamBuilder
impl Unpin for TychoStreamBuilder
impl UnwindSafe for TychoStreamBuilder
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