[][src]Struct noria::Table

pub struct Table { /* fields omitted */ }

A Table is used to perform writes, deletes, and other operations to data in base tables.

If you create multiple Table handles from a single ControllerHandle, they may share connections to the Soup workers. For this reason, Table is not Send or Sync. To get a handle that can be sent to a different thread (i.e., one with its own dedicated connections), call Table::into_exclusive.

Implementations

impl Table[src]

pub fn table_name(&self) -> &str[src]

Get the name of this base table.

pub fn columns(&self) -> &[String][src]

Get the list of columns in this base table.

Note that this will not be updated if the underlying recipe changes and adds or removes columns!

pub fn schema(&self) -> Option<&CreateTableStatement>[src]

Get the schema that was used to create this base table.

Note that this will not be updated if the underlying recipe changes and adds or removes columns!

pub async fn insert<'_, V>(&'_ mut self, u: V) -> Result<(), TableError> where
    V: Into<Vec<DataType>>, 
[src]

Insert a single row of data into this base table.

pub async fn perform_all<'_, I, V>(&'_ mut self, i: I) -> Result<(), TableError> where
    I: IntoIterator<Item = V>,
    V: Into<TableOperation>, 
[src]

Perform multiple operation on this base table.

pub async fn delete<'_, I>(&'_ mut self, key: I) -> Result<(), TableError> where
    I: Into<Vec<DataType>>, 
[src]

Delete the row with the given key from this base table.

pub async fn update<'_, V>(
    &'_ mut self,
    key: Vec<DataType>,
    u: V
) -> Result<(), TableError> where
    V: IntoIterator<Item = (usize, Modification)>, 
[src]

Update the row with the given key in this base table.

u is a set of column-modification pairs, where for each pair (i, m), the modification m will be applied to column i of the record with key key.

pub async fn insert_or_update<'_, V>(
    &'_ mut self,
    insert: Vec<DataType>,
    update: V
) -> Result<(), TableError> where
    V: IntoIterator<Item = (usize, Modification)>, 
[src]

Perform a insert-or-update on this base table.

If a row already exists for the key in insert, the existing row will instead be updated with the modifications in u (as documented in Table::update).

Trait Implementations

impl Clone for Table[src]

impl Debug for Table[src]

impl Service<Vec<TableOperation>> for Table[src]

type Error = TableError

Errors produced by the service.

type Response = <Buffer<ConcurrencyLimit<Balance<Discover<Client<MultiplexTransport<AsyncBincodeStream<TcpStream, Tagged<()>, Tagged<LocalOrNot<Input>>, AsyncDestination>, Tagger>, Error<MultiplexTransport<AsyncBincodeStream<TcpStream, Tagged<()>, Tagged<LocalOrNot<Input>>, AsyncDestination>, Tagger>, Tagged<LocalOrNot<Input>>>, Tagged<LocalOrNot<Input>>>>, Tagged<LocalOrNot<Input>>>>, Tagged<LocalOrNot<Input>>> as Service<Tagged<LocalOrNot<Input>>>>::Response

Responses given by the service.

type Future = Future<Result<Tagged<()>, TableError>>

The future response value.

Auto Trait Implementations

impl !RefUnwindSafe for Table

impl Send for Table

impl Sync for Table

impl Unpin for Table

impl !UnwindSafe for Table

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> Instrument 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> Sealed<T> for T where
    T: ?Sized

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

type Owned = T

The resulting type after obtaining ownership.

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]