Struct CloudTable

Source
pub struct CloudTable<C>
where C: Client,
{ /* private fields */ }
Expand description

Represents a table in the Microsoft Azure Table service.

Implementations§

Source§

impl<C> CloudTable<C>
where C: Client,

Source

pub fn new<T: Into<String>>(client: TableClient<C>, table: T) -> Self

Creates an CloadTable using the specified client and table name

Source

pub async fn create(&self) -> Result<(), AzureError>

Creates the table in the storage service with default request options.

Source

pub async fn create_if_not_exists(&self) -> Result<(), AzureError>

Creates the table in the storage service using default request options if it does not already exist.

Source

pub async fn get<T>( &self, partition_key: &str, row_key: &str, etag: Option<&str>, ) -> Result<Option<TableEntity<T>>, AzureError>

Source

pub async fn insert<T>( &self, partition_key: &str, row_key: &str, payload: T, ) -> Result<TableEntity<T>, AzureError>

Insert a new entity into the table. If entity already exists, the operation fails. See https://docs.microsoft.com/en-us/rest/api/storageservices/insert-entity

Source

pub async fn insert_entity<T>( &self, entity: TableEntity<T>, ) -> Result<TableEntity<T>, AzureError>

Source

pub async fn insert_or_update<T>( &self, partition_key: &str, row_key: &str, payload: T, ) -> Result<TableEntity<T>, AzureError>

Insert or updates an entity. Even if the entity is already present the operation succeeds and the entity is replaced. See https://docs.microsoft.com/en-us/rest/api/storageservices/insert-or-replace-entity

Source

pub async fn insert_or_update_entity<T>( &self, entity: TableEntity<T>, ) -> Result<TableEntity<T>, AzureError>

Source

pub async fn update_entity<T>( &self, entity: TableEntity<T>, ) -> Result<TableEntity<T>, AzureError>

Update an existing entity. See https://docs.microsoft.com/en-us/rest/api/storageservices/update-entity2

Source

pub async fn delete( &self, partition_key: &str, row_key: &str, etag: Option<&str>, ) -> Result<(), AzureError>

Source

pub async fn delete_entity<'a, T>( &self, entity: TableEntity<T>, ) -> Result<(), AzureError>

Source

pub async fn execute_query<T>( &self, query: Option<&str>, continuation: &mut Continuation, ) -> Result<Option<Vec<TableEntity<T>>>, AzureError>

Source

pub fn stream_query<'a, T>( &'a self, query: Option<&'a str>, ) -> impl Stream<Item = Result<Vec<TableEntity<T>>, AzureError>> + 'a
where T: Serialize + DeserializeOwned + 'a,

Source

pub async fn execute_batch(&self, batch: Batch) -> Result<(), AzureError>

Trait Implementations§

Source§

impl<C> Clone for CloudTable<C>
where C: Client + Clone,

Source§

fn clone(&self) -> CloudTable<C>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<C> Freeze for CloudTable<C>
where C: Freeze,

§

impl<C> RefUnwindSafe for CloudTable<C>
where C: RefUnwindSafe,

§

impl<C> Send for CloudTable<C>

§

impl<C> Sync for CloudTable<C>

§

impl<C> Unpin for CloudTable<C>
where C: Unpin,

§

impl<C> UnwindSafe for CloudTable<C>
where C: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T