pub struct Endpoint {
role: Role,
session: SessionStateMachine,
request_ids: RequestIdAllocator,
subscriptions: HashMap<u64, SubscriptionStateMachine>,
fetches: HashMap<u64, FetchStateMachine>,
subscribe_namespaces: HashMap<u64, SubscribeNamespaceStateMachine>,
subscribe_tracks: HashMap<u64, SubscribeNamespaceStateMachine>,
publish_namespaces: HashMap<u64, PublishNamespaceStateMachine>,
track_statuses: HashMap<u64, TrackStatusStateMachine>,
publishes: HashMap<u64, PublishStateMachine>,
goaway_uri: Option<Vec<u8>>,
}Fields§
§role: Role§session: SessionStateMachine§request_ids: RequestIdAllocator§subscriptions: HashMap<u64, SubscriptionStateMachine>§fetches: HashMap<u64, FetchStateMachine>§subscribe_namespaces: HashMap<u64, SubscribeNamespaceStateMachine>§subscribe_tracks: HashMap<u64, SubscribeNamespaceStateMachine>§publish_namespaces: HashMap<u64, PublishNamespaceStateMachine>§track_statuses: HashMap<u64, TrackStatusStateMachine>§publishes: HashMap<u64, PublishStateMachine>§goaway_uri: Option<Vec<u8>>Implementations§
Source§impl Endpoint
impl Endpoint
pub fn new(role: Role) -> Self
pub fn role(&self) -> Role
pub fn session_state(&self) -> SessionState
pub fn goaway_uri(&self) -> Option<&[u8]>
pub fn active_subscription_count(&self) -> usize
pub fn active_fetch_count(&self) -> usize
pub fn active_subscribe_namespace_count(&self) -> usize
pub fn active_subscribe_tracks_count(&self) -> usize
pub fn active_publish_namespace_count(&self) -> usize
pub fn active_track_status_count(&self) -> usize
pub fn active_publish_count(&self) -> usize
pub fn connect(&mut self) -> Result<(), EndpointError>
pub fn close(&mut self) -> Result<(), EndpointError>
Sourcepub fn send_setup(
&mut self,
options: Vec<KeyValuePair>,
) -> Result<ControlMessage, EndpointError>
pub fn send_setup( &mut self, options: Vec<KeyValuePair>, ) -> Result<ControlMessage, EndpointError>
Generate a SETUP message. Both client and server use the same message type; only the role (and the order of send/receive) distinguishes them.
Sourcepub fn receive_setup(&mut self, msg: &Setup) -> Result<(), EndpointError>
pub fn receive_setup(&mut self, msg: &Setup) -> Result<(), EndpointError>
Process an incoming SETUP message. Transitions the session to Active.
pub fn receive_goaway(&mut self, msg: &GoAway) -> Result<(), EndpointError>
fn require_active_or_err(&self) -> Result<(), EndpointError>
pub fn subscribe( &mut self, track_namespace: TrackNamespace, track_name: Vec<u8>, parameters: Vec<KeyValuePair>, ) -> Result<(VarInt, ControlMessage), EndpointError>
Sourcepub fn receive_subscribe_ok(
&mut self,
request_id: VarInt,
_msg: &SubscribeOk,
) -> Result<(), EndpointError>
pub fn receive_subscribe_ok( &mut self, request_id: VarInt, _msg: &SubscribeOk, ) -> Result<(), EndpointError>
Process an incoming SUBSCRIBE_OK. Draft-18: no request_id on wire; the
caller supplies the request_id of the bidi stream on which the
response arrived.
pub fn receive_request_update( &mut self, msg: &RequestUpdate, ) -> Result<(), EndpointError>
pub fn receive_publish_done( &mut self, request_id: VarInt, _msg: &PublishDone, ) -> Result<(), EndpointError>
pub fn fetch( &mut self, track_namespace: TrackNamespace, track_name: Vec<u8>, start_group: VarInt, start_object: VarInt, end_group: VarInt, end_object: VarInt, ) -> Result<(VarInt, ControlMessage), EndpointError>
pub fn joining_fetch( &mut self, joining_request_id: VarInt, joining_start: VarInt, ) -> Result<(VarInt, ControlMessage), EndpointError>
pub fn receive_fetch_ok( &mut self, request_id: VarInt, _msg: &FetchOk, ) -> Result<(), EndpointError>
pub fn on_fetch_stream_fin( &mut self, request_id: VarInt, ) -> Result<(), EndpointError>
pub fn on_fetch_stream_reset( &mut self, request_id: VarInt, ) -> Result<(), EndpointError>
pub fn subscribe_namespace( &mut self, namespace_prefix: TrackNamespace, parameters: Vec<KeyValuePair>, ) -> Result<(VarInt, ControlMessage), EndpointError>
pub fn subscribe_tracks( &mut self, namespace_prefix: TrackNamespace, parameters: Vec<KeyValuePair>, ) -> Result<(VarInt, ControlMessage), EndpointError>
pub fn publish_namespace( &mut self, track_namespace: TrackNamespace, parameters: Vec<KeyValuePair>, ) -> Result<(VarInt, ControlMessage), EndpointError>
pub fn track_status( &mut self, track_namespace: TrackNamespace, track_name: Vec<u8>, parameters: Vec<KeyValuePair>, ) -> Result<(VarInt, ControlMessage), EndpointError>
pub fn publish( &mut self, track_namespace: TrackNamespace, track_name: Vec<u8>, track_alias: VarInt, parameters: Vec<KeyValuePair>, track_properties: Vec<KeyValuePair>, ) -> Result<(VarInt, ControlMessage), EndpointError>
pub fn send_publish_done( &mut self, request_id: VarInt, status_code: VarInt, stream_count: VarInt, reason_phrase: Vec<u8>, ) -> Result<ControlMessage, EndpointError>
Sourcepub fn receive_request_ok(
&mut self,
request_id: VarInt,
_msg: &RequestOk,
) -> Result<(), EndpointError>
pub fn receive_request_ok( &mut self, request_id: VarInt, _msg: &RequestOk, ) -> Result<(), EndpointError>
Process an incoming REQUEST_OK on the bidi stream identified by
request_id. Draft-18: PUBLISH_OK is now a REQUEST_OK alias, so this
handler also resolves outstanding PUBLISH requests.
Sourcepub fn receive_request_error(
&mut self,
request_id: VarInt,
_msg: &RequestError,
) -> Result<(), EndpointError>
pub fn receive_request_error( &mut self, request_id: VarInt, _msg: &RequestError, ) -> Result<(), EndpointError>
Process an incoming REQUEST_ERROR on the bidi stream identified by
request_id.
pub fn receive_namespace( &mut self, _msg: &Namespace, ) -> Result<(), EndpointError>
pub fn receive_namespace_done( &mut self, _msg: &NamespaceDone, ) -> Result<(), EndpointError>
pub fn receive_publish_blocked( &mut self, _msg: &PublishBlocked, ) -> Result<(), EndpointError>
pub fn receive_message( &mut self, msg: ControlMessage, ) -> Result<(), EndpointError>
Sourcepub fn receive_response_on_stream(
&mut self,
request_id: VarInt,
msg: ControlMessage,
) -> Result<(), EndpointError>
pub fn receive_response_on_stream( &mut self, request_id: VarInt, msg: ControlMessage, ) -> Result<(), EndpointError>
Dispatch a response message that arrived on the bidi request stream
identified by request_id.
Auto Trait Implementations§
impl Freeze for Endpoint
impl RefUnwindSafe for Endpoint
impl Send for Endpoint
impl Sync for Endpoint
impl Unpin for Endpoint
impl UnsafeUnpin for Endpoint
impl UnwindSafe for Endpoint
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