Struct stitch::StitchClient
[−]
[src]
pub struct StitchClient { /* fields omitted */ }
Holds an inner representation of a stitch client. This type can be created on a separate thread and sent messages over a channel, or can be safely cloned many times on a single thread.
Methods
impl StitchClient
[src]
pub fn new<S>(handle: &Handle, client_id: u32, auth_token: S) -> Result<Self> where
S: Into<String>,
[src]
S: Into<String>,
Create a new stitch client.
pub fn client_id(&self) -> u32
[src]
Return the client_id
.
pub fn upsert_record<T>(&self, data: T) -> UpsertRequest<T> where
T: Message + Serialize,
[src]
T: Message + Serialize,
Upserts a single Message
, as a future.
pub fn get_status(&self) -> Future<Response>
[src]
Returns the current status of the stitch api, as a future.
pub fn validate_batch<T>(&self, record: Vec<T>) -> Future<Chunk> where
T: Message + Serialize,
[src]
T: Message + Serialize,
Validates a batch of Messages
, as a fture.
pub fn upsert_batch<T>(&self, record: Vec<T>) -> Future<Chunk> where
T: Message + Serialize,
[src]
T: Message + Serialize,
Upserts a batch of Messages
, as a future.
pub fn buffer_batches<T>(
&self,
stream: Receiver<T>,
batch_size: usize
) -> Future<()> where
T: Message + Serialize + Debug + 'static,
[src]
&self,
stream: Receiver<T>,
batch_size: usize
) -> Future<()> where
T: Message + Serialize + Debug + 'static,
Returns a future that represents a buffered stream,
represented by a futures::sync::mpsc::Receiver
.
The stream is chunked and each batch is sent to stitch.
Failures are logged and dropped.
Trait Implementations
impl Clone for StitchClient
[src]
fn clone(&self) -> StitchClient
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more