#[non_exhaustive]pub struct RiceDeltaEncoding {
pub first_value: i64,
pub rice_parameter: i32,
pub entry_count: i32,
pub encoded_data: Bytes,
/* private fields */
}Expand description
The Rice-Golomb encoded data. Used for sending compressed 4-byte hashes or compressed removal indices.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.first_value: i64The offset of the first entry in the encoded data, or, if only a single integer was encoded, that single integer’s value. If the field is empty or missing, assume zero.
rice_parameter: i32The Golomb-Rice parameter, which is a number between 2 and 28. This field
is missing (that is, zero) if num_entries is zero.
entry_count: i32The number of entries that are delta encoded in the encoded data. If only a
single integer was encoded, this will be zero and the single value will be
stored in first_value.
encoded_data: BytesThe encoded deltas that are encoded using the Golomb-Rice coder.
Implementations§
Source§impl RiceDeltaEncoding
impl RiceDeltaEncoding
pub fn new() -> Self
Sourcepub fn set_first_value<T: Into<i64>>(self, v: T) -> Self
pub fn set_first_value<T: Into<i64>>(self, v: T) -> Self
Sourcepub fn set_rice_parameter<T: Into<i32>>(self, v: T) -> Self
pub fn set_rice_parameter<T: Into<i32>>(self, v: T) -> Self
Sets the value of rice_parameter.
§Example
ⓘ
let x = RiceDeltaEncoding::new().set_rice_parameter(42);Sourcepub fn set_entry_count<T: Into<i32>>(self, v: T) -> Self
pub fn set_entry_count<T: Into<i32>>(self, v: T) -> Self
Sourcepub fn set_encoded_data<T: Into<Bytes>>(self, v: T) -> Self
pub fn set_encoded_data<T: Into<Bytes>>(self, v: T) -> Self
Sets the value of encoded_data.
§Example
ⓘ
let x = RiceDeltaEncoding::new().set_encoded_data(bytes::Bytes::from_static(b"example"));Trait Implementations§
Source§impl Clone for RiceDeltaEncoding
impl Clone for RiceDeltaEncoding
Source§fn clone(&self) -> RiceDeltaEncoding
fn clone(&self) -> RiceDeltaEncoding
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RiceDeltaEncoding
impl Debug for RiceDeltaEncoding
Source§impl Default for RiceDeltaEncoding
impl Default for RiceDeltaEncoding
Source§fn default() -> RiceDeltaEncoding
fn default() -> RiceDeltaEncoding
Returns the “default value” for a type. Read more
Source§impl Message for RiceDeltaEncoding
impl Message for RiceDeltaEncoding
Source§impl PartialEq for RiceDeltaEncoding
impl PartialEq for RiceDeltaEncoding
impl StructuralPartialEq for RiceDeltaEncoding
Auto Trait Implementations§
impl !Freeze for RiceDeltaEncoding
impl RefUnwindSafe for RiceDeltaEncoding
impl Send for RiceDeltaEncoding
impl Sync for RiceDeltaEncoding
impl Unpin for RiceDeltaEncoding
impl UnsafeUnpin for RiceDeltaEncoding
impl UnwindSafe for RiceDeltaEncoding
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