Struct shardio::ShardSender[][src]

pub struct ShardSender<T, S = DefaultSort> where
    T: Send + Serialize,
    S: SortKey<T>,
    <S as SortKey<T>>::Key: Ord + Clone + Serialize
{ /* fields omitted */ }

A handle that is used to send data to a ShardWriter. Each thread that is producing data needs it’s own ShardSender. A ShardSender can be obtained with the get_sender method of ShardWriter. ShardSender implement clone.

Implementations

impl<T: Send, S> ShardSender<T, S> where
    T: Send + Serialize,
    S: SortKey<T>,
    <S as SortKey<T>>::Key: Ord + Clone + Serialize
[src]

pub fn send(&mut self, item: T) -> Result<(), Error>[src]

Send an item to the shard file

pub fn finished(&mut self) -> Result<(), Error>[src]

Signal that you’ve finished sending items to this ShardSender. finished will called if the ShardSender is dropped. You must call finished() or drop the ShardSender prior to calling ShardWriter::finish or dropping the ShardWriter, or you will get a panic.

Trait Implementations

impl<T, S> Clone for ShardSender<T, S> where
    T: Send + Serialize,
    S: SortKey<T>,
    <S as SortKey<T>>::Key: Ord + Clone + Serialize
[src]

impl<T: Send, S: SortKey<T>> Drop for ShardSender<T, S> where
    T: Send + Serialize,
    S: SortKey<T>,
    <S as SortKey<T>>::Key: Ord + Clone + Serialize
[src]

Auto Trait Implementations

impl<T, S> RefUnwindSafe for ShardSender<T, S> where
    T: RefUnwindSafe

impl<T, S> Send for ShardSender<T, S> where
    <S as SortKey<T>>::Key: Send

impl<T, S> Sync for ShardSender<T, S> where
    T: Sync,
    <S as SortKey<T>>::Key: Send

impl<T, S> Unpin for ShardSender<T, S> where
    T: Unpin

impl<T, S> UnwindSafe for ShardSender<T, S> where
    T: UnwindSafe

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<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[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.