pub struct WebSocketSession { /* private fields */ }Expand description
WebSocket streaming session
Implementations§
Source§impl WebSocketSession
impl WebSocketSession
Sourcepub fn new(id: String, config: WebSocketConfig) -> Self
pub fn new(id: String, config: WebSocketConfig) -> Self
Create a new WebSocket session
Sourcepub async fn start_query(
&self,
query_id: String,
sparql: String,
) -> Result<Receiver<WebSocketMessage>>
pub async fn start_query( &self, query_id: String, sparql: String, ) -> Result<Receiver<WebSocketMessage>>
Start a query execution
Sourcepub async fn stream_results(
&self,
query_id: &str,
variables: Vec<Variable>,
bindings: Vec<Binding>,
) -> Result<()>
pub async fn stream_results( &self, query_id: &str, variables: Vec<Variable>, bindings: Vec<Binding>, ) -> Result<()>
Stream results for a query
Note: Solution is Vec<Binding>, where Binding is HashMap<Variable, Term>
For streaming, we expect bindings (individual solutions), not Solution (Vec<Binding>)
Sourcepub async fn cancel_query(&self, query_id: &str) -> Result<()>
pub async fn cancel_query(&self, query_id: &str) -> Result<()>
Cancel a query
Sourcepub async fn send_error(&self, query_id: &str, error: String) -> Result<()>
pub async fn send_error(&self, query_id: &str, error: String) -> Result<()>
Send error to query
Sourcepub async fn statistics(&self) -> ConnectionStats
pub async fn statistics(&self) -> ConnectionStats
Get session statistics
Sourcepub fn is_healthy(&self) -> bool
pub fn is_healthy(&self) -> bool
Check if session is healthy
Auto Trait Implementations§
impl Freeze for WebSocketSession
impl !RefUnwindSafe for WebSocketSession
impl Send for WebSocketSession
impl Sync for WebSocketSession
impl Unpin for WebSocketSession
impl UnsafeUnpin for WebSocketSession
impl !UnwindSafe for WebSocketSession
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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.