pub struct StreamSubscription {
pub id: String,
pub source: String,
pub transform: Option<String>,
pub interval: Option<Duration>,
pub active: bool,
pub last_seq: u64,
pub error_count: u32,
}Expand description
Subscription to a data source.
Fields§
§id: StringUnique subscription ID
source: StringData source path
transform: Option<String>Transform expression to apply
interval: Option<Duration>Refresh interval
active: boolWhether this subscription is active
last_seq: u64Last received sequence number
error_count: u32Error count for backoff
Implementations§
Source§impl StreamSubscription
impl StreamSubscription
Sourcepub fn with_id(id: impl Into<String>, source: impl Into<String>) -> Self
pub fn with_id(id: impl Into<String>, source: impl Into<String>) -> Self
Create with explicit ID.
Sourcepub fn with_interval(self, ms: u64) -> Self
pub fn with_interval(self, ms: u64) -> Self
Set refresh interval in milliseconds.
Sourcepub fn with_transform(self, transform: impl Into<String>) -> Self
pub fn with_transform(self, transform: impl Into<String>) -> Self
Set transform expression.
Sourcepub fn to_message(&self) -> StreamMessage
pub fn to_message(&self) -> StreamMessage
Convert to subscribe message.
Trait Implementations§
Source§impl Clone for StreamSubscription
impl Clone for StreamSubscription
Source§fn clone(&self) -> StreamSubscription
fn clone(&self) -> StreamSubscription
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for StreamSubscription
impl RefUnwindSafe for StreamSubscription
impl Send for StreamSubscription
impl Sync for StreamSubscription
impl Unpin for StreamSubscription
impl UnwindSafe for StreamSubscription
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> 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