pub struct FeedHandler { /* private fields */ }Expand description
Processes incoming WebSocket messages and converts them to Nautilus domain objects.
The handler owns the WebSocketClient exclusively within the lock-free I/O boundary, eliminating RwLock contention on the hot path.
Implementations§
Source§impl FeedHandler
impl FeedHandler
Sourcepub fn new(
account_id: Option<AccountId>,
cmd_rx: UnboundedReceiver<HandlerCommand>,
out_tx: UnboundedSender<NautilusWsMessage>,
raw_rx: UnboundedReceiver<Message>,
client: WebSocketClient,
signal: Arc<AtomicBool>,
) -> Self
pub fn new( account_id: Option<AccountId>, cmd_rx: UnboundedReceiver<HandlerCommand>, out_tx: UnboundedSender<NautilusWsMessage>, raw_rx: UnboundedReceiver<Message>, client: WebSocketClient, signal: Arc<AtomicBool>, ) -> Self
Creates a new FeedHandler.
Sourcepub fn register_bar_type(&mut self, topic: String, bar_type: BarType)
pub fn register_bar_type(&mut self, topic: String, bar_type: BarType)
Registers a bar type for a specific topic (e.g., “BTC-USD/1MIN”).
Sourcepub fn unregister_bar_type(&mut self, topic: &str)
pub fn unregister_bar_type(&mut self, topic: &str)
Unregisters a bar type for a specific topic.
Sourcepub fn handle_message(
&self,
msg: DydxWsMessage,
) -> DydxWsResult<Option<NautilusWsMessage>>
pub fn handle_message( &self, msg: DydxWsMessage, ) -> DydxWsResult<Option<NautilusWsMessage>>
Processes a WebSocket message and converts it to Nautilus domain objects.
§Errors
Returns an error if message parsing fails.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FeedHandler
impl !RefUnwindSafe for FeedHandler
impl Send for FeedHandler
impl Sync for FeedHandler
impl Unpin for FeedHandler
impl !UnwindSafe for FeedHandler
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].