pub struct SpanBatchBits(/* private fields */);
Available on crate feature
protocol
only.Expand description
Type for span batch bits.
Implementations§
Source§impl SpanBatchBits
impl SpanBatchBits
Sourcepub const fn new(inner: Vec<u8>) -> SpanBatchBits
pub const fn new(inner: Vec<u8>) -> SpanBatchBits
Creates a new span batch bits.
Sourcepub fn decode(
b: &mut &[u8],
bit_length: usize,
) -> Result<SpanBatchBits, SpanBatchError>
pub fn decode( b: &mut &[u8], bit_length: usize, ) -> Result<SpanBatchBits, 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 dyn BufMut,
bit_length: usize,
bits: &SpanBatchBits,
) -> Result<(), SpanBatchError>
pub fn encode( w: &mut dyn BufMut, bit_length: usize, bits: &SpanBatchBits, ) -> 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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§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> 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>,
Encode 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>,
Encode 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
).