lightstreamer_rs/client/request.rs
1/******************************************************************************
2 Author: Joaquín Béjar García
3 Email: jb@taunais.com
4 Date: 16/5/25
5******************************************************************************/
6use crate::subscription::Subscription;
7
8/// A request to subscribe or unsubscribe from a Lightstreamer data stream.
9///
10/// This struct is used internally by the LightstreamerClient to manage subscription
11/// and unsubscription operations. It contains either a Subscription object for new
12/// subscriptions or a subscription ID for unsubscribing from an existing subscription.
13pub struct SubscriptionRequest {
14 /// The subscription to be added. Set to None when unsubscribing.
15 pub(crate) subscription: Option<Subscription>,
16 /// The ID of the subscription to be removed. Set to None when subscribing.
17 pub(crate) subscription_id: Option<usize>,
18}