Struct skytable::Connection [−][src]
pub struct Connection { /* fields omitted */ }
sync
only.Expand description
A Connection
is a wrapper around aTcpStream
and a read buffer
Implementations
impl Connection
[src]
impl Connection
[src]pub fn new(host: &str, port: u16) -> IoResult<Self>
[src]
pub fn new(host: &str, port: u16) -> IoResult<Self>
[src]Create a new connection to a Skytable instance hosted on host
and running on port
pub fn run_simple_query(&mut self, query: &Query) -> IoResult<Response>
[src]
pub fn run_simple_query(&mut self, query: &Query) -> IoResult<Response>
[src]This function will write a Query
to the stream and read the response from the
server. It will then determine if the returned response is complete or incomplete
or invalid and return an appropriate variant of Response
wrapped in IoResult
for any I/O errors that may occur
Panics
This method will panic if the Query
supplied is empty (i.e has no arguments)
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl UnwindSafe for Connection
Blanket Implementations
impl<T> Actions for T where
T: SyncSocket,
[src]
impl<T> Actions for T where
T: SyncSocket,
[src]fn dbsize<'s>(&'s mut self) -> ActionResult<usize>
[src]
fn dbsize<'s>(&'s mut self) -> ActionResult<usize>
[src]sync
only.Get the number of keys present in the database
fn del<'s>(
&'s mut self,
key: impl IntoSkyhashAction + 's
) -> ActionResult<usize>
[src]
fn del<'s>(
&'s mut self,
key: impl IntoSkyhashAction + 's
) -> ActionResult<usize>
[src]sync
only.Deletes a single or a number of keys Read more
fn exists<'s>(
&'s mut self,
key: impl IntoSkyhashAction + 's
) -> ActionResult<usize>
[src]
fn exists<'s>(
&'s mut self,
key: impl IntoSkyhashAction + 's
) -> ActionResult<usize>
[src]sync
only.Checks if a key (or keys) exist(s) Read more
fn flushdb<'s>(&'s mut self) -> ActionResult<()>
[src]
fn flushdb<'s>(&'s mut self) -> ActionResult<()>
[src]sync
only.Removes all the keys present in the database
fn get<'s>(
&'s mut self,
key: impl IntoSkyhashBytes + 's
) -> ActionResult<String>
[src]
fn get<'s>(
&'s mut self,
key: impl IntoSkyhashBytes + 's
) -> ActionResult<String>
[src]sync
only.Get the value of a key
fn keylen<'s>(
&'s mut self,
key: impl IntoSkyhashBytes + 's
) -> ActionResult<usize>
[src]
fn keylen<'s>(
&'s mut self,
key: impl IntoSkyhashBytes + 's
) -> ActionResult<usize>
[src]sync
only.Get the length of a key
fn lskeys<'s>(&'s mut self, count: usize) -> ActionResult<Vec<String>>
[src]
fn lskeys<'s>(&'s mut self, count: usize) -> ActionResult<Vec<String>>
[src]sync
only.Returns a vector of keys Read more
fn mget<'s>(
&'s mut self,
keys: impl IntoSkyhashAction + 's
) -> ActionResult<Vec<Element>>
[src]
fn mget<'s>(
&'s mut self,
keys: impl IntoSkyhashAction + 's
) -> ActionResult<Vec<Element>>
[src]sync
only.Get multiple keys Read more
fn mksnap<'s>(&'s mut self) -> ActionResult<SnapshotResult>
[src]
fn mksnap<'s>(&'s mut self) -> ActionResult<SnapshotResult>
[src]sync
only.Creates a snapshot Read more
fn mset<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
&'s mut self,
keys: impl GetIterator<T> + 's,
values: impl GetIterator<U> + 's
) -> ActionResult<usize>
[src]
fn mset<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
&'s mut self,
keys: impl GetIterator<T> + 's,
values: impl GetIterator<U> + 's
) -> ActionResult<usize>
[src]sync
only.Sets the value of multiple keys and values and returns the number of keys that were set Read more
fn mupdate<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
&'s mut self,
keys: impl GetIterator<T> + 's,
values: impl GetIterator<U> + 's
) -> ActionResult<usize>
[src]
fn mupdate<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
&'s mut self,
keys: impl GetIterator<T> + 's,
values: impl GetIterator<U> + 's
) -> ActionResult<usize>
[src]sync
only.Updates the value of multiple keys and values and returns the number of keys that were updated Read more
fn sdel<'s>(
&'s mut self,
keys: impl IntoSkyhashAction + 's
) -> ActionResult<bool>
[src]
fn sdel<'s>(
&'s mut self,
keys: impl IntoSkyhashAction + 's
) -> ActionResult<bool>
[src]sync
only.Deletes all the provided keys if they exist or doesn’t do anything at all. This method will return true if all the provided keys were deleted, else it will return false Read more
fn set<'s>(
&'s mut self,
key: impl IntoSkyhashBytes + 's,
value: impl IntoSkyhashBytes + 's
) -> ActionResult<()>
[src]
fn set<'s>(
&'s mut self,
key: impl IntoSkyhashBytes + 's,
value: impl IntoSkyhashBytes + 's
) -> ActionResult<()>
[src]sync
only.Set the value of a key
fn sset<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
&'s mut self,
keys: impl GetIterator<T> + 's,
values: impl GetIterator<U> + 's
) -> ActionResult<bool>
[src]
fn sset<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
&'s mut self,
keys: impl GetIterator<T> + 's,
values: impl GetIterator<U> + 's
) -> ActionResult<bool>
[src]sync
only.Sets the value of all the provided keys or does nothing. This method will return true if all the keys were set or will return false if none were set Read more
fn supdate<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
&'s mut self,
keys: impl GetIterator<T> + 's,
values: impl GetIterator<U> + 's
) -> ActionResult<bool>
[src]
fn supdate<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
&'s mut self,
keys: impl GetIterator<T> + 's,
values: impl GetIterator<U> + 's
) -> ActionResult<bool>
[src]sync
only.Updates the value of all the provided keys or does nothing. This method will return true if all the keys were updated or will return false if none were updated Read more
fn update<'s>(
&'s mut self,
key: impl IntoSkyhashBytes + 's,
value: impl IntoSkyhashBytes + 's
) -> ActionResult<()>
[src]
fn update<'s>(
&'s mut self,
key: impl IntoSkyhashBytes + 's,
value: impl IntoSkyhashBytes + 's
) -> ActionResult<()>
[src]sync
only.Update the value of a key
fn uset<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
&'s mut self,
keys: impl GetIterator<T> + 's,
values: impl GetIterator<U> + 's
) -> ActionResult<usize>
[src]
fn uset<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
&'s mut self,
keys: impl GetIterator<T> + 's,
values: impl GetIterator<U> + 's
) -> ActionResult<usize>
[src]sync
only.Updates or sets all the provided keys and returns the number of keys that were set Read more
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more