pub struct Stream { /* private fields */ }Expand description
Priority data stream entity
Implementations§
Source§impl Stream
impl Stream
Sourcepub fn new(
session_id: SessionId,
source_data: JsonData,
config: StreamConfig,
) -> Stream
pub fn new( session_id: SessionId, source_data: JsonData, config: StreamConfig, ) -> Stream
Create new stream
Sourcepub fn session_id(&self) -> SessionId
pub fn session_id(&self) -> SessionId
Get session ID
Sourcepub fn state(&self) -> &StreamState
pub fn state(&self) -> &StreamState
Get current state
Sourcepub fn config(&self) -> &StreamConfig
pub fn config(&self) -> &StreamConfig
Get configuration
Sourcepub fn stats(&self) -> &StreamStats
pub fn stats(&self) -> &StreamStats
Get statistics
Sourcepub fn created_at(&self) -> DateTime<Utc>
pub fn created_at(&self) -> DateTime<Utc>
Get creation timestamp
Sourcepub fn updated_at(&self) -> DateTime<Utc>
pub fn updated_at(&self) -> DateTime<Utc>
Get last update timestamp
Sourcepub fn completed_at(&self) -> Option<DateTime<Utc>>
pub fn completed_at(&self) -> Option<DateTime<Utc>>
Get completion timestamp
Sourcepub fn source_data(&self) -> Option<&JsonData>
pub fn source_data(&self) -> Option<&JsonData>
Get source data
Sourcepub fn add_metadata(&mut self, key: String, value: String)
pub fn add_metadata(&mut self, key: String, value: String)
Add metadata
Sourcepub fn start_streaming(&mut self) -> Result<(), DomainError>
pub fn start_streaming(&mut self) -> Result<(), DomainError>
Start streaming (transition to Streaming state)
Sourcepub fn complete(&mut self) -> Result<(), DomainError>
pub fn complete(&mut self) -> Result<(), DomainError>
Complete stream successfully
Sourcepub fn cancel(&mut self) -> Result<(), DomainError>
pub fn cancel(&mut self) -> Result<(), DomainError>
Cancel stream
Sourcepub fn create_skeleton_frame(&mut self) -> Result<Frame, DomainError>
pub fn create_skeleton_frame(&mut self) -> Result<Frame, DomainError>
Generate skeleton frame for the stream
Sourcepub fn create_patch_frames(
&mut self,
priority_threshold: Priority,
max_frames: usize,
) -> Result<Vec<Frame>, DomainError>
pub fn create_patch_frames( &mut self, priority_threshold: Priority, max_frames: usize, ) -> Result<Vec<Frame>, DomainError>
Create batch of patch frames based on priority
Sourcepub fn create_completion_frame(
&mut self,
checksum: Option<String>,
) -> Result<Frame, DomainError>
pub fn create_completion_frame( &mut self, checksum: Option<String>, ) -> Result<Frame, DomainError>
Create completion frame
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Check if stream is finished
Sourcepub fn update_config(&mut self, config: StreamConfig) -> Result<(), DomainError>
pub fn update_config(&mut self, config: StreamConfig) -> Result<(), DomainError>
Update configuration
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Stream
impl<'de> Deserialize<'de> for Stream
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Stream, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Stream, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Stream
impl Serialize for Stream
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for Stream
impl RefUnwindSafe for Stream
impl Send for Stream
impl Sync for Stream
impl Unpin for Stream
impl UnwindSafe for Stream
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<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 more