[−][src]Struct nakadion::publisher::partitioner::Partitioner
Determines partitions based on hashes
Methods
impl Partitioner<DefaultBuildHasher>
[src]
pub fn new(partitions: Vec<PartitionId>) -> Self
[src]
Create a new instance with the given partitions.
The order of the given partitions will not be changed.
Panics
If partitions is empty
pub fn new_sorted(partitions: Vec<PartitionId>) -> Self
[src]
Create a new instance with the given partitions.
The partitions will be sorted by first trying to convert the partitions to numbers and sorting by these. Otherwise they will be sorted ba their contained string.
Panics
If partitions is empty
pub async fn from_event_type<'_, C>(
event_type: &'_ EventTypeName,
api_client: C
) -> Result<Self, NakadiApiError> where
C: MonitoringApi,
[src]
event_type: &'_ EventTypeName,
api_client: C
) -> Result<Self, NakadiApiError> where
C: MonitoringApi,
Create a new instance for the partitions of the given event type.
The partitions will be sorted by first trying to convert the partitions to numbers and sorting by these. Otherwise they will be sorted ba their contained string.
Fails if the event type has no partitions.
impl<B> Partitioner<B> where
B: BuildHasher + Clone,
[src]
B: BuildHasher + Clone,
pub fn new_with_hasher(partitions: Vec<PartitionId>, build_hasher: B) -> Self
[src]
Create a new instance with the given partitions and a provided hashing algorithm.
The order of the given partitions will not be changed.
Panics
If partitions is empty
pub fn new_sorted_with_hasher(
partitions: Vec<PartitionId>,
build_hasher: B
) -> Self
[src]
partitions: Vec<PartitionId>,
build_hasher: B
) -> Self
Create a new instance with the given partitions and a provided hashing algorithm.
The partitions will be sorted by first trying to convert the partitions to numbers and sorting by these. Otherwise they will be sorted ba their contained string.
Panics
If partitions is empty
pub async fn from_event_type_with_hasher<'_, C>(
event_type: &'_ EventTypeName,
api_client: C,
build_hasher: B
) -> Result<Self, NakadiApiError> where
C: MonitoringApi,
[src]
event_type: &'_ EventTypeName,
api_client: C,
build_hasher: B
) -> Result<Self, NakadiApiError> where
C: MonitoringApi,
Create a new instance for the partitions of the given event type and a provided hashing algorithm.
The partitions will be sorted by first trying to convert the partitions to numbers and sorting by these. Otherwise they will be sorted ba their contained string.
Fails if the event type has no partitions.
pub fn assign<E: PartitionKeyExtractable + PartitionAssignable>(
self,
event: &mut E
)
[src]
self,
event: &mut E
)
Determines and assigns partitions
pub fn partitions(&self) -> &[PartitionId]
[src]
Returns the partitions as used by the Partitioner
Trait Implementations
impl<B: Clone + BuildHasher> Clone for Partitioner<B>
[src]
fn clone(&self) -> Partitioner<B>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl<B> RefUnwindSafe for Partitioner<B> where
B: RefUnwindSafe,
B: RefUnwindSafe,
impl<B> Send for Partitioner<B> where
B: Send,
B: Send,
impl<B> Sync for Partitioner<B> where
B: Sync,
B: Sync,
impl<B> Unpin for Partitioner<B> where
B: Unpin,
B: Unpin,
impl<B> UnwindSafe for Partitioner<B> where
B: UnwindSafe,
B: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SendSyncUnwindSafe for T where
T: Send + Sync + UnwindSafe + ?Sized,
T: Send + Sync + UnwindSafe + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,