pub struct RangePartitioner { /* private fields */ }Expand description
Range-based partitioner for value-based distribution.
Implementations§
Source§impl RangePartitioner
impl RangePartitioner
Sourcepub fn new(boundaries: Vec<f64>) -> Result<Self>
pub fn new(boundaries: Vec<f64>) -> Result<Self>
Create a new range partitioner with specified boundaries.
Sourcepub fn partition_for_value(&self, value: f64) -> PartitionId
pub fn partition_for_value(&self, value: f64) -> PartitionId
Compute partition ID for a value.
Sourcepub fn num_partitions(&self) -> usize
pub fn num_partitions(&self) -> usize
Get the total number of partitions.
Auto Trait Implementations§
impl Freeze for RangePartitioner
impl RefUnwindSafe for RangePartitioner
impl Send for RangePartitioner
impl Sync for RangePartitioner
impl Unpin for RangePartitioner
impl UnsafeUnpin for RangePartitioner
impl UnwindSafe for RangePartitioner
Blanket Implementations§
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request