pub struct NetworkingConfig<Tr: ?Sized, S: ?Sized, Name = ()> { /* private fields */ }Expand description
A network channel configuration with T as transport backend and S as the serialization
backend.
Implementations§
Source§impl<Tr: ?Sized, S: ?Sized> NetworkingConfig<Tr, S>
impl<Tr: ?Sized, S: ?Sized> NetworkingConfig<Tr, S>
Source§impl<Tr: ?Sized, N> NetworkingConfig<Tr, NoSer, N>
impl<Tr: ?Sized, N> NetworkingConfig<Tr, NoSer, N>
Sourcepub const fn bincode(self) -> NetworkingConfig<Tr, Bincode, N>
pub const fn bincode(self) -> NetworkingConfig<Tr, Bincode, N>
Configures the network channel to use bincode to serialize items.
Source§impl<S: ?Sized> NetworkingConfig<Tcp<()>, S>
impl<S: ?Sized> NetworkingConfig<Tcp<()>, S>
Sourcepub const fn fail_stop(self) -> NetworkingConfig<Tcp<FailStop>, S>
pub const fn fail_stop(self) -> NetworkingConfig<Tcp<FailStop>, S>
Configures the TCP transport to stop sending messages after a failed connection.
Note that the Hydro simulator will not simulate connection failures that impact the
liveness of a program. If an output assertion depends on a fail_stop channel
making progress, that channel will not experience a failure that would cause the test to
block indefinitely. However, any safety issues caused by connection failures will still
be caught, such as a race condition between a failed connection and some other message.
Sourcepub const fn lossy(self, nondet: NonDet) -> NetworkingConfig<Tcp<Lossy>, S>
pub const fn lossy(self, nondet: NonDet) -> NetworkingConfig<Tcp<Lossy>, S>
Configures the TCP transport to allow messages to be lost.
This is appropriate for networks where messages may be dropped, such as when
running under a Maelstrom partition nemesis. Unlike fail_stop, which guarantees
a prefix of messages is delivered, lossy makes no such guarantee.
§Non-Determinism
A lossy TCP channel will non-deterministically drop messages during execution.
Sourcepub const fn lossy_delayed_forever(
self,
) -> NetworkingConfig<Tcp<LossyDelayedForever>, S>
pub const fn lossy_delayed_forever( self, ) -> NetworkingConfig<Tcp<LossyDelayedForever>, S>
Configures the TCP transport to treat dropped messages as indefinitely delayed.
This is appropriate for networks where messages may be dropped, such as when
running under a Maelstrom partition nemesis. Unlike Self::lossy, this does
not require a NonDet annotation because the output is always lower in the
partial order than the ideal stream. However, the output stream will have
NoOrder guarantees, imposing stricter conditions on downstream consumers.
Unlike Self::lossy, this mode can easily be simulated in exhaustive mode
without running into fairness issues.
When using this mode in the Hydro simulator, you must call
.test_safety_only() to opt in,
because the simulator models dropped messages as indefinitely delayed, which only
tests safety properties (not liveness).
Trait Implementations§
Source§impl<Tr, S, T: ?Sized> NetworkFor<T> for NetworkingConfig<Tr, S>
impl<Tr, S, T: ?Sized> NetworkFor<T> for NetworkingConfig<Tr, S>
Source§type OrderingGuarantee = <Tr as TransportKind>::OrderingGuarantee
type OrderingGuarantee = <Tr as TransportKind>::OrderingGuarantee
O, the output ordering
will be <O as MinOrder<Self::OrderingGuarantee>>::Min.Source§fn serialize_thunk(is_demux: bool) -> Expr
fn serialize_thunk(is_demux: bool) -> Expr
T.Source§fn deserialize_thunk(tagged: Option<&Type>) -> Expr
fn deserialize_thunk(tagged: Option<&Type>) -> Expr
T.Source§fn networking_info() -> NetworkingInfo
fn networking_info() -> NetworkingInfo
NetworkingInfo describing this network channel’s transport and fault model.Source§impl<Tr, S, T: ?Sized> NetworkFor<T> for NetworkingConfig<Tr, S, String>
impl<Tr, S, T: ?Sized> NetworkFor<T> for NetworkingConfig<Tr, S, String>
Source§type OrderingGuarantee = <Tr as TransportKind>::OrderingGuarantee
type OrderingGuarantee = <Tr as TransportKind>::OrderingGuarantee
O, the output ordering
will be <O as MinOrder<Self::OrderingGuarantee>>::Min.Source§fn serialize_thunk(is_demux: bool) -> Expr
fn serialize_thunk(is_demux: bool) -> Expr
T.Source§fn deserialize_thunk(tagged: Option<&Type>) -> Expr
fn deserialize_thunk(tagged: Option<&Type>) -> Expr
T.Source§fn networking_info() -> NetworkingInfo
fn networking_info() -> NetworkingInfo
NetworkingInfo describing this network channel’s transport and fault model.Auto Trait Implementations§
impl<Tr, S, Name> Freeze for NetworkingConfig<Tr, S, Name>
impl<Tr, S, Name> RefUnwindSafe for NetworkingConfig<Tr, S, Name>
impl<Tr, S, Name> Send for NetworkingConfig<Tr, S, Name>
impl<Tr, S, Name> Sync for NetworkingConfig<Tr, S, Name>
impl<Tr, S, Name> Unpin for NetworkingConfig<Tr, S, Name>
impl<Tr, S, Name> UnsafeUnpin for NetworkingConfig<Tr, S, Name>
impl<Tr, S, Name> UnwindSafe for NetworkingConfig<Tr, S, Name>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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