pub struct StreamingConfig {Show 14 fields
pub writer_path: String,
pub catalog: Option<DataCatalogConfig>,
pub flush_interval_ms: u64,
pub replace_existing: bool,
pub rotation_config: RotationConfig,
pub promotion_interval_ms: Option<u64>,
pub promote_on_close: bool,
pub delete_feather_after_promotion: bool,
pub use_ts_event_for_ts_init: bool,
pub data_types: Option<Vec<NautilusDataType>>,
pub record_types: Option<Vec<NautilusRecordType>>,
pub instrument_types: Option<Vec<NautilusInstrumentType>>,
pub record_filters: Option<Vec<StreamingRecordFilterConfig>>,
pub params: Option<Params>,
}Expand description
Configuration streaming live or backtest runs to a persistence writer.
The writer appends Feather files under the local writer_path, in one
{backtest|sandbox|live}/{instance_id} directory per run. With a catalog, the writer for
that catalog’s backend also promotes the files into it; without one, the Feather files are the
only output.
Fields§
§writer_path: StringLocal directory the writer appends Feather files to.
catalog: Option<DataCatalogConfig>Catalog that receives promoted data; omit to keep only the Feather files.
flush_interval_ms: u64Flush interval in milliseconds.
replace_existing: boolWhether to replace existing files.
rotation_config: RotationConfigRotation configuration.
promotion_interval_ms: Option<u64>Interval in milliseconds for promoting sealed files into catalog; omit for no interval.
promote_on_close: boolWhether closing the writer promotes remaining files into catalog.
delete_feather_after_promotion: boolWhether Feather files are deleted after a successful promotion.
use_ts_event_for_ts_init: boolWhether promotion replaces ts_init with ts_event.
data_types: Option<Vec<NautilusDataType>>Optional data families to write.
record_types: Option<Vec<NautilusRecordType>>Optional record families to write.
instrument_types: Option<Vec<NautilusInstrumentType>>Optional instrument families to write.
record_filters: Option<Vec<StreamingRecordFilterConfig>>Optional record family and identifier filters.
params: Option<Params>Backend-specific writer parameters.
Implementations§
Source§impl StreamingConfig
impl StreamingConfig
Sourcepub fn builder() -> StreamingConfigBuilder
pub fn builder() -> StreamingConfigBuilder
Create an instance of StreamingConfig using the builder syntax
Source§impl StreamingConfig
impl StreamingConfig
Sourcepub fn new(
writer_path: String,
catalog: Option<DataCatalogConfig>,
flush_interval_ms: u64,
replace_existing: bool,
rotation_config: RotationConfig,
) -> Self
pub fn new( writer_path: String, catalog: Option<DataCatalogConfig>, flush_interval_ms: u64, replace_existing: bool, rotation_config: RotationConfig, ) -> Self
Creates new StreamingConfig instance.
Sourcepub fn validate(&self) -> ConfigResult<()>
pub fn validate(&self) -> ConfigResult<()>
Validates the streaming configuration, collecting every field violation.
§Errors
Returns an error if any field fails validation. Multiple validation failures are collected into one error.
Sourcepub fn writer_backend(&self) -> WriterBackendType
pub fn writer_backend(&self) -> WriterBackendType
Returns the writer backend: Feather without a catalog, otherwise the catalog’s backend.
Trait Implementations§
Source§impl Clone for StreamingConfig
impl Clone for StreamingConfig
Source§impl Debug for StreamingConfig
impl Debug for StreamingConfig
impl DerefToPyAny for StreamingConfig
Source§impl<'de> Deserialize<'de> for StreamingConfig
impl<'de> Deserialize<'de> for StreamingConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<'a, 'py> FromPyObject<'a, 'py> for StreamingConfigwhere
Self: Clone,
impl<'a, 'py> FromPyObject<'a, 'py> for StreamingConfigwhere
Self: Clone,
Source§impl<'py> IntoPyObject<'py> for StreamingConfig
impl<'py> IntoPyObject<'py> for StreamingConfig
Source§type Target = StreamingConfig
type Target = StreamingConfig
Source§type Output = Bound<'py, <StreamingConfig as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <StreamingConfig as IntoPyObject<'py>>::Target>
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Source§impl PyClass for StreamingConfig
impl PyClass for StreamingConfig
Source§impl PyClassImpl for StreamingConfig
impl PyClassImpl for StreamingConfig
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
Source§const RAW_DOC: &'static CStr = /// Configuration streaming live or backtest runs to a persistence writer.
///
/// The writer appends Feather files under the local `writer_path`, in one
/// `{backtest|sandbox|live}/{instance_id}` directory per run. With a `catalog`, the writer for
/// that catalog's backend also promotes the files into it; without one, the Feather files are the
/// only output.
const RAW_DOC: &'static CStr = /// Configuration streaming live or backtest runs to a persistence writer. /// /// The writer appends Feather files under the local `writer_path`, in one /// `{backtest|sandbox|live}/{instance_id}` directory per run. With a `catalog`, the writer for /// that catalog's backend also promotes the files into it; without one, the Feather files are the /// only output.
Source§const DOC: &'static CStr
const DOC: &'static CStr
text_signature if a constructor is defined. Read moreSource§type Layout = <<StreamingConfig as PyClassImpl>::BaseNativeType as PyClassBaseType>::Layout<StreamingConfig>
type Layout = <<StreamingConfig as PyClassImpl>::BaseNativeType as PyClassBaseType>::Layout<StreamingConfig>
Source§type ThreadChecker = NoopThreadChecker
type ThreadChecker = NoopThreadChecker
type Inventory = Pyo3MethodsInventoryForStreamingConfig
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::ImmutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::ImmutableChild
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
§fn dict_offset() -> Option<PyObjectOffset>
fn dict_offset() -> Option<PyObjectOffset>
§fn weaklist_offset() -> Option<PyObjectOffset>
fn weaklist_offset() -> Option<PyObjectOffset>
Source§impl PyClassNewTextSignature for StreamingConfig
impl PyClassNewTextSignature for StreamingConfig
const TEXT_SIGNATURE: &'static str = "(writer_path, catalog=None, flush_interval_ms=1000, replace_existing=False, rotation_config=None, promotion_interval_ms=None, promote_on_close=True, delete_feather_after_promotion=False, use_ts_event_for_ts_init=False, data_types=None, record_types=None, instrument_types=None, record_filters=None, params=None)"
Source§impl PyStubType for StreamingConfig
impl PyStubType for StreamingConfig
Source§fn type_output() -> TypeInfo
fn type_output() -> TypeInfo
§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
Source§impl PyTypeInfo for StreamingConfig
impl PyTypeInfo for StreamingConfig
Source§const NAME: &str = <Self as ::pyo3::PyClass>::NAME
const NAME: &str = <Self as ::pyo3::PyClass>::NAME
prefer using ::type_object(py).name() to get the correct runtime value
Source§const MODULE: Option<&str> = <Self as ::pyo3::impl_::pyclass::PyClassImpl>::MODULE
const MODULE: Option<&str> = <Self as ::pyo3::impl_::pyclass::PyClassImpl>::MODULE
prefer using ::type_object(py).module() to get the correct runtime value
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
§fn is_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_type_of(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type or a subclass of this type.§fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type.Auto Trait Implementations§
impl Freeze for StreamingConfig
impl RefUnwindSafe for StreamingConfig
impl Send for StreamingConfig
impl Sync for StreamingConfig
impl Unpin for StreamingConfig
impl UnsafeUnpin for StreamingConfig
impl UnwindSafe for StreamingConfig
Blanket Implementations§
impl<T> Allocation for T
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<'py, T> FromPyObjectOwned<'py> for Twhere
T: for<'a> FromPyObject<'a, 'py>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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 more§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
self into an owned Python object, dropping type information.§fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
self into an owned Python object, dropping type information and unbinding it
from the 'py lifetime.§fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
self into a Python object. Read more§impl<'py, T> IntoPyObjectNautilusExt<'py> for Twhere
T: IntoPyObjectExt<'py>,
impl<'py, T> IntoPyObjectNautilusExt<'py> for Twhere
T: IntoPyObjectExt<'py>,
§fn into_py_any_unwrap(self, py: Python<'py>) -> Py<PyAny>where
Self: IntoPyObject<'py, Error = !>,
fn into_py_any_unwrap(self, py: Python<'py>) -> Py<PyAny>where
Self: IntoPyObject<'py, Error = !>,
self into a [Py<PyAny>] when the underlying conversion is infallible.§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
§fn type_check(object: &Bound<'_, PyAny>) -> bool
fn type_check(object: &Bound<'_, PyAny>) -> bool
§fn classinfo_object(py: Python<'_>) -> Bound<'_, PyAny>
fn classinfo_object(py: Python<'_>) -> Bound<'_, PyAny>
isinstance and issubclass function. Read more