Struct test_raftstore::RegionPacketFilter[][src]

pub struct RegionPacketFilter {
    region_id: u64,
    store_id: u64,
    direction: Direction,
    block: Either<Arc<AtomicUsize>, Arc<AtomicBool>>,
    drop_type: Vec<MessageType>,
    skip_type: Vec<MessageType>,
    dropped_messages: Option<Arc<Mutex<Vec<RaftMessage>>>>,
    msg_callback: Option<Arc<dyn Fn(&RaftMessage) + Send + Sync>>,
}

Drop specified messages for the store with special region.

If drop_type is empty, all message will be dropped.

Fields

region_id: u64store_id: u64direction: Directionblock: Either<Arc<AtomicUsize>, Arc<AtomicBool>>drop_type: Vec<MessageType>skip_type: Vec<MessageType>dropped_messages: Option<Arc<Mutex<Vec<RaftMessage>>>>msg_callback: Option<Arc<dyn Fn(&RaftMessage) + Send + Sync>>

Implementations

impl RegionPacketFilter[src]

pub fn new(region_id: u64, store_id: u64) -> RegionPacketFilter[src]

pub fn direction(self, direction: Direction) -> RegionPacketFilter[src]

pub fn msg_type(self, m_type: MessageType) -> RegionPacketFilter[src]

pub fn skip(self, m_type: MessageType) -> RegionPacketFilter[src]

pub fn allow(self, number: usize) -> RegionPacketFilter[src]

pub fn when(self, condition: Arc<AtomicBool>) -> RegionPacketFilter[src]

pub fn reserve_dropped(
    self,
    dropped: Arc<Mutex<Vec<RaftMessage>>>
) -> RegionPacketFilter
[src]

pub fn set_msg_callback(
    self,
    cb: Arc<dyn Fn(&RaftMessage) + Send + Sync>
) -> RegionPacketFilter
[src]

Trait Implementations

impl Clone for RegionPacketFilter[src]

impl Filter for RegionPacketFilter[src]

Auto Trait Implementations

impl !RefUnwindSafe for RegionPacketFilter

impl Send for RegionPacketFilter

impl Sync for RegionPacketFilter

impl Unpin for RegionPacketFilter

impl !UnwindSafe for RegionPacketFilter

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<V, W> ConvertFrom<W> for V where
    W: ConvertTo<V>, 
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> Sealed<T> for T where
    T: ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]