Struct exar::Subscription [] [src]

pub struct Subscription {
    pub event_stream_sender: Sender<EventStreamMessage>,
    pub query: Query,
    // some fields omitted
}

Exar DB's subscription.

Examples

extern crate exar;

use exar::*;
use std::sync::mpsc::channel;

let (sender, receiver) = channel();
let event = Event::new("data", vec!["tag1", "tag2"]);

let mut subscription = Subscription::new(sender, Query::current());
subscription.send(event).unwrap();
let event_stream_message = receiver.recv().unwrap();

Fields

The channel sender used to stream EventStreamMessages back to the subscriber.

The query associated to this subscription.

Methods

impl Subscription
[src]

Creates a new Subscription with the given channel sender and query.

Sends an Event to the subscriber or returns a DatabaseError if a failure occurs.

Returns wether the subscription is still active.

Returns wether the subscription is interested in the given Event.

Trait Implementations

impl Clone for Subscription
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Subscription
[src]

Formats the value using the given formatter.