[][src]Struct ciruela::cluster::Connection

pub struct Connection { /* fields omitted */ }

Connection to a server or cluster of servers

Ciruela automatically manages a number of connections according to configs and the operations over connection (i.e. images currently uploading).

Methods

impl Connection
[src]

Create a connection pool object

Warning: constructor should run on loop provieded by tk_easyloop. In future, tokio will provide implicit loop reference on it's own.

The actual underlying connections are established when specific operation is requested. Also you don't need to specify all node name in the cluster, they will be discovered.

There are two common patterns:

  1. [preferred] Use a DNS name that resolves to a full list of IP addresses. Common DNS servers randomize them and only spill few of the adressses because of DNS package size limit, but that's fine, as we only need 3 or so of them.
  2. Specify 3-5 server names and leave the discover to ciruela itself.

While you can specify a name that refers to only one address, it's not a very good idea (unless you really have one server) because the server you're connecting to may fail.

Initiate a new upload (appending a directory)

Panics

If connection set is already closed

Initiate a new upload (appending a directory, if not exists)

This is basically same as 'append()` but ignores errors when directory already exists (or currently downloading) but has different contents.

Panics

If connection set is already closed

Initiate a new upload (replacing a directory)

Panics

If connection set is already closed

Initiate a new upload (replacing if directory hash matches)

Panics

If connection set is already closed

Fetch index of a directory that is currently on the server

Fetch file relative to the index

Panics

Panics if there is no such file in the index

Trait Implementations

impl Clone for Connection
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Connection
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Connection

impl Sync for Connection

Blanket Implementations

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

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> From for T
[src]

Performs the conversion.

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

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

Immutably borrows from an owned value. Read more

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

Mutably borrows from an owned value. Read more

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

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

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

impl<T> Same for T

Should always be Self

impl<T> Erased for T

impl<T> Any for T where
    T: Any
[src]