pub struct NetworkRules { /* private fields */ }Expand description
Shared per-cluster partition rules. Each (src, dst) pair in the
set causes sends from src to dst to be silently dropped. The
rules are bidirectional when set via Self::partition; one-way
partitions can be constructed by adding a single pair via
Self::drop_pair.
Implementations§
Source§impl NetworkRules
impl NetworkRules
Sourcepub fn partition(&self, side_a: &[SocketAddr], side_b: &[SocketAddr])
pub fn partition(&self, side_a: &[SocketAddr], side_b: &[SocketAddr])
Partition the cluster so no traffic flows between side_a and
side_b in either direction. Within each side, traffic is
unaffected.
Sourcepub fn drop_pair(&self, src: SocketAddr, dst: SocketAddr)
pub fn drop_pair(&self, src: SocketAddr, dst: SocketAddr)
Add a one-way drop rule for a specific (src, dst) pair.
Sourcepub fn is_dropped(&self, src: SocketAddr, dst: SocketAddr) -> bool
pub fn is_dropped(&self, src: SocketAddr, dst: SocketAddr) -> bool
True if the (src, dst) pair is currently partitioned.
Trait Implementations§
Source§impl Debug for NetworkRules
impl Debug for NetworkRules
Auto Trait Implementations§
impl !Freeze for NetworkRules
impl !RefUnwindSafe for NetworkRules
impl Send for NetworkRules
impl Sync for NetworkRules
impl Unpin for NetworkRules
impl UnsafeUnpin for NetworkRules
impl UnwindSafe for NetworkRules
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.