Struct tarantool::net_box::Conn[][src]

pub struct Conn { /* fields omitted */ }

Connection to remote Tarantool server

Implementations

impl Conn[src]

pub fn new(addr: &str, options: ConnOptions) -> Result<Self, Error>[src]

Create a new connection.

The connection is established on demand, at the time of the first request. It can be re-established automatically after a disconnect (see reconnect_after option). The returned conn object supports methods for making remote requests, such as select, update or delete.

See also: ConnOptions

pub fn wait_connected(&self, timeout: Option<Duration>) -> Result<bool, Error>[src]

Wait for connection to be active or closed.

Returns:

  • Ok(true): if active
  • Ok(true): if closed
  • Err(...TimedOut...): on timeout

pub fn is_connected(&self) -> bool[src]

Show whether connection is active or closed.

pub fn close(&self)[src]

Close a connection.

pub fn ping(&self, options: &Options) -> Result<(), Error>[src]

Execute a PING command.

  • options – the supported option is timeout

pub fn call<T>(
    &self,
    function_name: &str,
    args: &T,
    options: &Options
) -> Result<Option<Tuple>, Error> where
    T: AsTuple
[src]

Call a remote stored procedure.

conn.call("func", &("1", "2", "3")) is the remote-call equivalent of func('1', '2', '3'). That is, conn.call is a remote stored-procedure call. The return from conn.call is whatever the function returns.

pub fn eval<T>(
    &self,
    expression: &str,
    args: &T,
    options: &Options
) -> Result<Option<Tuple>, Error> where
    T: AsTuple
[src]

Evaluates and executes the expression in Lua-string, which may be any statement or series of statements.

An execute privilege is required; if the user does not have it, an administrator may grant it with box.schema.user.grant(username, 'execute', 'universe').

To ensure that the return from eval is whatever the Lua expression returns, begin the Lua-string with the word return.

pub fn space(&self, name: &str) -> Result<Option<RemoteSpace>, Error>[src]

Search space by name on remote server

Trait Implementations

impl Drop for Conn[src]

Auto Trait Implementations

impl !RefUnwindSafe for Conn

impl !Send for Conn

impl !Sync for Conn

impl Unpin for Conn

impl !UnwindSafe for Conn

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.