pub struct SpanBatchBits(/* private fields */);
Expand description
Type for span batch bits.
Implementations§
Source§impl SpanBatchBits
impl SpanBatchBits
Sourcepub fn decode(b: &mut &[u8], bit_length: usize) -> Result<Self, SpanBatchError>
pub fn decode(b: &mut &[u8], bit_length: usize) -> Result<Self, SpanBatchError>
Decodes a standard span-batch bitlist from a reader.
The bitlist is encoded as big-endian integer, left-padded with zeroes to a multiple of 8
bits. The encoded bitlist cannot be longer than bit_length
.
Sourcepub fn encode(
w: &mut Vec<u8>,
bit_length: usize,
bits: &Self,
) -> Result<(), SpanBatchError>
pub fn encode( w: &mut Vec<u8>, bit_length: usize, bits: &Self, ) -> Result<(), SpanBatchError>
Encodes a standard span-batch bitlist.
The bitlist is encoded as big-endian integer, left-padded with zeroes to a multiple of 8
bits. The encoded bitlist cannot be longer than bit_length
Sourcepub fn set_bit(&mut self, index: usize, value: bool)
pub fn set_bit(&mut self, index: usize, value: bool)
Sets a bit in the SpanBatchBits bitlist.
Sourcepub fn bit_len(&self) -> usize
pub fn bit_len(&self) -> usize
Calculates the bit length of the SpanBatchBits bitfield.
Trait Implementations§
Source§impl AsRef<[u8]> for SpanBatchBits
impl AsRef<[u8]> for SpanBatchBits
Source§impl Clone for SpanBatchBits
impl Clone for SpanBatchBits
Source§fn clone(&self) -> SpanBatchBits
fn clone(&self) -> SpanBatchBits
Returns a copy 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 SpanBatchBits
impl Debug for SpanBatchBits
Source§impl Default for SpanBatchBits
impl Default for SpanBatchBits
Source§fn default() -> SpanBatchBits
fn default() -> SpanBatchBits
Returns the “default value” for a type. Read more
Source§impl PartialEq for SpanBatchBits
impl PartialEq for SpanBatchBits
impl Eq for SpanBatchBits
impl StructuralPartialEq for SpanBatchBits
Auto Trait Implementations§
impl Freeze for SpanBatchBits
impl RefUnwindSafe for SpanBatchBits
impl Send for SpanBatchBits
impl Sync for SpanBatchBits
impl Unpin for SpanBatchBits
impl UnwindSafe for SpanBatchBits
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
👎Deprecated: use
ToHexExt
insteadEncode the hex strict representing
self
into the result.
Lower case letters are used (e.g. f9b4ca
).Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
👎Deprecated: use
ToHexExt
insteadEncode the hex strict representing
self
into the result.
Upper case letters are used (e.g. F9B4CA
).Source§impl<T> ToHexExt for T
impl<T> ToHexExt for T
Source§fn encode_hex(&self) -> String
fn encode_hex(&self) -> String
Encode the hex strict representing
self
into the result.
Lower case letters are used (e.g. f9b4ca
).Source§fn encode_hex_upper(&self) -> String
fn encode_hex_upper(&self) -> String
Encode the hex strict representing
self
into the result.
Upper case letters are used (e.g. F9B4CA
).Source§fn encode_hex_with_prefix(&self) -> String
fn encode_hex_with_prefix(&self) -> String
Encode the hex strict representing
self
into the result with prefix 0x
.
Lower case letters are used (e.g. 0xf9b4ca
).Source§fn encode_hex_upper_with_prefix(&self) -> String
fn encode_hex_upper_with_prefix(&self) -> String
Encode the hex strict representing
self
into the result with prefix 0X
.
Upper case letters are used (e.g. 0xF9B4CA
).