[−][src]Struct noria::prelude::Table
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]
V: Into<Vec<DataType>>,
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]
I: IntoIterator<Item = V>,
V: Into<TableOperation>,
Perform multiple operation on this base table.
pub async fn delete<'_, I>(&'_ mut self, key: I) -> Result<(), TableError> where
I: Into<Vec<DataType>>,
[src]
I: Into<Vec<DataType>>,
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]
&'_ mut self,
key: Vec<DataType>,
u: V
) -> Result<(), TableError> where
V: IntoIterator<Item = (usize, Modification)>,
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]
&'_ mut self,
insert: Vec<DataType>,
update: V
) -> Result<(), TableError> where
V: IntoIterator<Item = (usize, Modification)>,
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.
fn poll_ready(&mut self, cx: &mut Context) -> Poll<Result<(), Self::Error>>
[src]
fn call(&mut self, ops: Vec<TableOperation>) -> Self::Future
[src]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Sealed<T> for T where
T: ?Sized,
T: ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,