Struct dbn::flags::FlagSet

source ·
pub struct FlagSet { /* private fields */ }
Expand description

A transparent wrapper around the bit field used in several DBN record types, namely MboMsg and record types derived from it.

Implementations§

source§

impl FlagSet

source

pub const fn empty() -> Self

Returns an empty FlagSet: one with no flags set.

source

pub const fn new(raw: u8) -> Self

Creates a new flag set from raw.

source

pub fn clear(&mut self) -> &mut Self

Turns all flags off, i.e. to false.

source

pub const fn raw(&self) -> u8

Returns the raw value.

source

pub fn set_raw(&mut self, raw: u8)

Sets the flags directly with a raw u8.

source

pub const fn any(&self) -> bool

Returns true if any of the flags are on or set to true.

source

pub fn is_empty(&self) -> bool

Returns true if all flags are unset/false.

source

pub const fn is_last(&self) -> bool

Returns true if it’s the last record in the event from the venue for a given instrument_id.

source

pub fn set_last(&mut self) -> Self

Sets the LAST bit flag to true to indicate this is the last record in the event for a given instrument.

source

pub const fn is_tob(&self) -> bool

Returns true if it’s a top-of-book record, not an individual order.

source

pub fn set_tob(&mut self) -> Self

Sets the TOB bit flag to true to indicate this is a top-of-book record.

source

pub const fn is_snapshot(&self) -> bool

Returns true if this record was sourced from a replay, such as a snapshot server.

source

pub fn set_snapshot(&mut self) -> Self

Sets the SNAPSHOT bit flag to true to indicate this record was sourced from a replay.

source

pub const fn is_mbp(&self) -> bool

Returns true if this record is an aggregated price level record, not an individual order.

source

pub fn set_mbp(&mut self) -> Self

Sets the MBP bit flag to true to indicate this record is an aggregated price level record.

source

pub const fn is_bad_ts_recv(&self) -> bool

Returns true if this record has an inaccurate ts_recv value due to clock issues or packet reordering.

source

pub fn set_bad_ts_recv(&mut self) -> Self

Sets the BAD_TS_RECV bit flag to true to indicate this record has an inaccurate ts_recv value.

source

pub const fn is_maybe_bad_book(&self) -> bool

Returns true if this record is from a channel where an unrecoverable gap was detected.

source

pub fn set_maybe_bad_book(&mut self) -> Self

Sets the MAYBE_BAD_BOOK bit flag to true to indicate this record is from a channel where an unrecoverable gap was detected.

Trait Implementations§

source§

impl Clone for FlagSet

source§

fn clone(&self) -> FlagSet

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FlagSet

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for FlagSet

source§

fn default() -> FlagSet

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for FlagSet

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<u8> for FlagSet

source§

fn from(raw: u8) -> Self

Converts to this type from the input type.
source§

impl<'py> FromPyObject<'py> for FlagSet

source§

fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>

Extracts Self from the bound smart pointer obj. Read more
source§

impl Hash for FlagSet

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl IntoPy<Py<PyAny>> for FlagSet

Available on crate feature python only.
source§

fn into_py(self, py: Python<'_>) -> PyObject

Performs the conversion.
source§

impl PartialEq for FlagSet

source§

fn eq(&self, other: &FlagSet) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for FlagSet

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Copy for FlagSet

source§

impl Eq for FlagSet

source§

impl StructuralPartialEq for FlagSet

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<'py, T> FromPyObjectBound<'_, 'py> for T
where T: FromPyObject<'py>,

source§

fn from_py_object_bound(ob: Borrowed<'_, 'py, PyAny>) -> Result<T, PyErr>

Extracts Self from the bound smart pointer obj. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> PyErrArguments for T
where T: IntoPy<Py<PyAny>> + Send + Sync,

source§

fn arguments(self, py: Python<'_>) -> Py<PyAny>

Arguments for exception
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<T> Ungil for T
where T: Send,