Struct data_streaming_service::data_stream::DataStream
source · [−]pub struct DataStream<T> { /* private fields */ }Expand description
Each data stream holds the original stream request from the client and tracks the progress of the data stream to satisfy that request (e.g., the data that has already been sent along the stream to the client and the in-flight Aptos data client requests that have been sent to the network).
Note that it is the responsibility of the data stream to send data notifications along the stream in sequential order (e.g., transactions and proofs must be sent with monotonically increasing versions).
Implementations
sourceimpl<T: AptosDataClient + Send + Clone + 'static> DataStream<T>
impl<T: AptosDataClient + Send + Clone + 'static> DataStream<T>
pub fn new(
config: DataStreamingServiceConfig,
data_stream_id: DataStreamId,
stream_request: &StreamRequest,
aptos_data_client: T,
notification_id_generator: Arc<U64IdGenerator>,
advertised_data: &AdvertisedData
) -> Result<(Self, DataStreamListener), Error>
sourcepub fn data_requests_initialized(&self) -> bool
pub fn data_requests_initialized(&self) -> bool
Returns true iff the first batch of data client requests has been sent
sourcepub fn initialize_data_requests(
&mut self,
global_data_summary: GlobalDataSummary
) -> Result<(), Error>
pub fn initialize_data_requests(
&mut self,
global_data_summary: GlobalDataSummary
) -> Result<(), Error>
Initializes the data client requests by sending out the first batch
sourcepub fn sent_notification(&self, notification_id: &NotificationId) -> bool
pub fn sent_notification(&self, notification_id: &NotificationId) -> bool
Returns true iff the given notification_id was sent by this stream
sourcepub fn handle_notification_feedback(
&self,
notification_id: &NotificationId,
notification_feedback: &NotificationFeedback
) -> Result<(), Error>
pub fn handle_notification_feedback(
&self,
notification_id: &NotificationId,
notification_feedback: &NotificationFeedback
) -> Result<(), Error>
Notifies the Aptos data client of a bad client response
sourcepub fn process_data_responses(
&mut self,
global_data_summary: GlobalDataSummary
) -> Result<(), Error>
pub fn process_data_responses(
&mut self,
global_data_summary: GlobalDataSummary
) -> Result<(), Error>
Processes any data client responses that have been received. Note: the responses must be processed in FIFO order.
sourcepub fn ensure_data_is_available(
&self,
advertised_data: &AdvertisedData
) -> Result<(), Error>
pub fn ensure_data_is_available(
&self,
advertised_data: &AdvertisedData
) -> Result<(), Error>
Verifies that the data required by the stream can be satisfied using the currently advertised data in the network. If not, returns an error.
Trait Implementations
sourceimpl<T: Debug> Debug for DataStream<T>
impl<T: Debug> Debug for DataStream<T>
sourceimpl<T> Drop for DataStream<T>
impl<T> Drop for DataStream<T>
Auto Trait Implementations
impl<T> !RefUnwindSafe for DataStream<T>
impl<T> Send for DataStream<T> where
T: Send,
impl<T> !Sync for DataStream<T>
impl<T> Unpin for DataStream<T> where
T: Unpin,
impl<T> !UnwindSafe for DataStream<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more