Struct google_api_proto::google::firestore::v1::BitSequence
source · pub struct BitSequence {
pub bitmap: Bytes,
pub padding: i32,
}
Expand description
A sequence of bits, encoded in a byte array.
Each byte in the bitmap
byte array stores 8 bits of the sequence. The only
exception is the last byte, which may store 8 or fewer bits. The padding
defines the number of bits of the last byte to be ignored as “padding”. The
values of these “padding” bits are unspecified and must be ignored.
To retrieve the first bit, bit 0, calculate: (bitmap\[0\] & 0x01) != 0
.
To retrieve the second bit, bit 1, calculate: (bitmap\[0\] & 0x02) != 0
.
To retrieve the third bit, bit 2, calculate: (bitmap\[0\] & 0x04) != 0
.
To retrieve the fourth bit, bit 3, calculate: (bitmap\[0\] & 0x08) != 0
.
To retrieve bit n, calculate: (bitmap\[n / 8\] & (0x01 << (n % 8))) != 0
.
The “size” of a BitSequence
(the number of bits it contains) is calculated
by this formula: (bitmap.length * 8) - padding
.
Fields§
§bitmap: Bytes
The bytes that encode the bit sequence. May have a length of zero.
padding: i32
The number of bits of the last byte in bitmap
to ignore as “padding”.
If the length of bitmap
is zero, then this value must be 0
.
Otherwise, this value must be between 0 and 7, inclusive.
Trait Implementations§
source§impl Clone for BitSequence
impl Clone for BitSequence
source§fn clone(&self) -> BitSequence
fn clone(&self) -> BitSequence
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for BitSequence
impl Debug for BitSequence
source§impl Default for BitSequence
impl Default for BitSequence
source§impl Message for BitSequence
impl Message for BitSequence
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for BitSequence
impl PartialEq for BitSequence
source§fn eq(&self, other: &BitSequence) -> bool
fn eq(&self, other: &BitSequence) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for BitSequence
Auto Trait Implementations§
impl !Freeze for BitSequence
impl RefUnwindSafe for BitSequence
impl Send for BitSequence
impl Sync for BitSequence
impl Unpin for BitSequence
impl UnwindSafe for BitSequence
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
T
in a tonic::Request