Struct DrainContainerDistributor

Source
pub struct DrainContainerDistributor<CB, H> { /* private fields */ }
Expand description

A distributor creating containers from a drainable container based on a hash function of the container’s item.

Implementations§

Source§

impl<CB: Default, H> DrainContainerDistributor<CB, H>

Source

pub fn new(hash_func: H, peers: usize) -> Self

Constructs a new DrainContainerDistributor with the given hash function for a number of peers.

Trait Implementations§

Source§

impl<CB, H> Distributor<<CB as ContainerBuilder>::Container> for DrainContainerDistributor<CB, H>
where CB: ContainerBuilder<Container: DrainContainer> + for<'a> PushInto<<CB::Container as DrainContainer>::Item<'a>>, for<'a> H: FnMut(&<CB::Container as DrainContainer>::Item<'a>) -> u64,

Source§

fn partition<T: Clone, P: Push<Message<T, CB::Container>>>( &mut self, container: &mut CB::Container, time: &T, pushers: &mut [P], )

Partition the contents of container at time into the pushers.
Source§

fn flush<T: Clone, P: Push<Message<T, CB::Container>>>( &mut self, time: &T, pushers: &mut [P], )

Flush any remaining contents into the pushers at time time.
Source§

fn relax(&mut self)

Optionally release resources, such as memory.

Auto Trait Implementations§

§

impl<CB, H> Freeze for DrainContainerDistributor<CB, H>
where H: Freeze,

§

impl<CB, H> RefUnwindSafe for DrainContainerDistributor<CB, H>

§

impl<CB, H> Send for DrainContainerDistributor<CB, H>
where H: Send, CB: Send,

§

impl<CB, H> Sync for DrainContainerDistributor<CB, H>
where H: Sync, CB: Sync,

§

impl<CB, H> Unpin for DrainContainerDistributor<CB, H>
where H: Unpin, CB: Unpin,

§

impl<CB, H> UnwindSafe for DrainContainerDistributor<CB, H>
where H: UnwindSafe, CB: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.