pub struct MaelstromMeta {
pub node_id: String,
pub node_ids: Vec<String>,
/* private fields */
}Available on crate feature
deploy and (crate features maelstrom or maelstrom_runtime) only.Expand description
Metadata for a Maelstrom node, populated from the init message. Also manages a shared stdin reader that broadcasts lines to multiple subscribers.
Fields§
§node_id: String§node_ids: Vec<String>Implementations§
Source§impl MaelstromMeta
impl MaelstromMeta
Sourcepub fn subscribe_stdin(&self) -> BroadcastStream<String>
pub fn subscribe_stdin(&self) -> BroadcastStream<String>
Subscribe to stdin lines. Each subscriber receives all lines read from stdin. Multiple subscribers can be created and each will receive a copy of every line.
Sourcepub fn start_receiving(&self)
pub fn start_receiving(&self)
Start receiving incoming messages from clients and other nodes, after launching the DFIR.
Auto Trait Implementations§
impl Freeze for MaelstromMeta
impl !RefUnwindSafe for MaelstromMeta
impl Send for MaelstromMeta
impl Sync for MaelstromMeta
impl Unpin for MaelstromMeta
impl !UnwindSafe for MaelstromMeta
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 moreCreates a shared type from an unshared type.