pub struct SubIdGen(/* private fields */);Expand description
Hands out [SubscriptionId]s: 1, 2, 3, … (after start), never repeating.
The market data connector starts at 0 and the user data connector at 1000, so that ids from the two connectors of one process are easy to tell apart in logs. Thread safe.
§Examples
use brokapi_finam::subs::SubIdGen;
let ids = SubIdGen::new(1000);
let first = ids.next();
let second = ids.next();
assert_ne!(first, second);Implementations§
Auto Trait Implementations§
impl !Freeze for SubIdGen
impl RefUnwindSafe for SubIdGen
impl Send for SubIdGen
impl Sync for SubIdGen
impl Unpin for SubIdGen
impl UnsafeUnpin for SubIdGen
impl UnwindSafe for SubIdGen
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>
§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].