Movatterモバイル変換


[0]ホーム

URL:


Docs.rs

[][src]Structpostgres::Transaction

pub struct Transaction<'a> { /* fields omitted */ }

A representation of a PostgreSQL database transaction.

Transactions will implicitly roll back by default when dropped. Use thecommit method to commit the changes madein the transaction. Transactions can be nested, with inner transactions implemented via savepoints.

Methods

impl<'a>Transaction<'a>[src]

pub fncommit(self) ->Result<(),Error>[src]

Consumes the transaction, committing all changes made within it.

pub fnrollback(self) ->Result<(),Error>[src]

Rolls the transaction back, discarding all changes made within it.

This is equivalent toTransaction'sDrop implementation, but provides any error encountered to the caller.

pub fnprepare(&mut self, query: &str) ->Result<Statement,Error>[src]

LikeClient::prepare.

pub fnprepare_typed(
    &mut self,
    query: &str,
    types:&[Type]
) ->Result<Statement,Error>
[src]

LikeClient::prepare_typed.

pub fnexecute<T: ?Sized>(
    &mut self,
    query:&T,
    params:&[&(dynToSql +Sync)]
) ->Result<u64,Error>where
    T:ToStatement
[src]

LikeClient::execute.

pub fnquery<T: ?Sized>(
    &mut self,
    query:&T,
    params:&[&(dynToSql +Sync)]
) ->Result<Vec<Row>,Error>where
    T:ToStatement
[src]

LikeClient::query.

pub fnquery_one<T: ?Sized>(
    &mut self,
    query:&T,
    params:&[&(dynToSql +Sync)]
) ->Result<Row,Error>where
    T:ToStatement
[src]

LikeClient::query_one.

pub fnquery_opt<T: ?Sized>(
    &mut self,
    query:&T,
    params:&[&(dynToSql +Sync)]
) ->Result<Option<Row>,Error>where
    T:ToStatement
[src]

LikeClient::query_opt.

pub fnquery_raw<'b, T: ?Sized, I>(
    &mut self,
    query:&T,
    params: I
) ->Result<RowIter,Error>where
    T:ToStatement,
    I:IntoIterator<Item = &'b dynToSql>,
    I::IntoIter:ExactSizeIterator
[src]

LikeClient::query_raw.

pub fnbind<T: ?Sized>(
    &mut self,
    query:&T,
    params:&[&(dynToSql +Sync)]
) ->Result<Portal,Error>where
    T:ToStatement
[src]

Binds parameters to a statement, creating a "portal".

Portals can be used with thequery_portal method to page through the results of a query without being forcedto consume them all immediately.

Portals are automatically closed when the transaction they were created in is closed.

Panics

Panics if the number of parameters provided does not match the number expected.

pub fnquery_portal(
    &mut self,
    portal: &Portal,
    max_rows:i32
) ->Result<Vec<Row>,Error>
[src]

Continues execution of a portal, returning the next set of rows.

Unlikequery, portals can be incrementally evaluated by limiting the number of rows returned in each call toquery_portal. If the requested number is negative or 0, all remaining rows will be returned.

pub fnquery_portal_raw(
    &mut self,
    portal: &Portal,
    max_rows:i32
) ->Result<RowIter,Error>
[src]

The maximally flexible version ofquery_portal.

pub fncopy_in<T: ?Sized>(&mut self, query:&T) ->Result<CopyInWriter,Error>where
    T:ToStatement
[src]

LikeClient::copy_in.

pub fncopy_out<T: ?Sized>(&mut self, query:&T) ->Result<CopyOutReader,Error>where
    T:ToStatement
[src]

LikeClient::copy_out.

pub fnsimple_query(
    &mut self,
    query: &str
) ->Result<Vec<SimpleQueryMessage>,Error>
[src]

LikeClient::simple_query.

pub fnbatch_execute(&mut self, query: &str) ->Result<(),Error>[src]

LikeClient::batch_execute.

pub fncancel_token(&self) ->CancelToken[src]

LikeClient::cancel_token.

pub fntransaction(&mut self) ->Result<Transaction,Error>[src]

LikeClient::transaction.

Trait Implementations

impl<'_>GenericClient forTransaction<'_>[src]

fnexecute<T: ?Sized>(
    &mut self,
    query:&T,
    params:&[&(dynToSql +Sync)]
) ->Result<u64,Error>where
    T:ToStatement
[src]

fnquery<T: ?Sized>(
    &mut self,
    query:&T,
    params:&[&(dynToSql +Sync)]
) ->Result<Vec<Row>,Error>where
    T:ToStatement
[src]

fnquery_one<T: ?Sized>(
    &mut self,
    query:&T,
    params:&[&(dynToSql +Sync)]
) ->Result<Row,Error>where
    T:ToStatement
[src]

fnquery_opt<T: ?Sized>(
    &mut self,
    query:&T,
    params:&[&(dynToSql +Sync)]
) ->Result<Option<Row>,Error>where
    T:ToStatement
[src]

fnquery_raw<'a, T: ?Sized, I>(
    &mut self,
    query:&T,
    params: I
) ->Result<RowIter,Error>where
    T:ToStatement,
    I:IntoIterator<Item = &'a dynToSql>,
    I::IntoIter:ExactSizeIterator
[src]

fnprepare(&mut self, query: &str) ->Result<Statement,Error>[src]

fnprepare_typed(
    &mut self,
    query: &str,
    types:&[Type]
) ->Result<Statement,Error>
[src]

fncopy_in<T: ?Sized>(&mut self, query:&T) ->Result<CopyInWriter,Error>where
    T:ToStatement
[src]

fncopy_out<T: ?Sized>(&mut self, query:&T) ->Result<CopyOutReader,Error>where
    T:ToStatement
[src]

fnsimple_query(
    &mut self,
    query: &str
) ->Result<Vec<SimpleQueryMessage>,Error>
[src]

fnbatch_execute(&mut self, query: &str) ->Result<(),Error>[src]

fntransaction(&mut self) ->Result<Transaction,Error>[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe forTransaction<'a>

impl<'a>Send forTransaction<'a>

impl<'a>Sync forTransaction<'a>

impl<'a>Unpin forTransaction<'a>

impl<'a> !UnwindSafe forTransaction<'a>

Blanket Implementations

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

fntype_id(&self) ->TypeId[src]

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

fnborrow(&self) ->&T[src]

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

fnborrow_mut(&mut self) ->&mutT[src]

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

fnfrom(t: T) -> T[src]

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

fninto(self) -> U[src]

impl<T> Same<T> for T

typeOutput = T

Should always beSelf

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

typeError =Infallible

The type returned in the event of a conversion error.

fntry_from(value: U) ->Result<T, <T asTryFrom<U>>::Error>[src]

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

typeError = <U asTryFrom<T>>::Error

The type returned in the event of a conversion error.

fntry_into(self) ->Result<U, <U asTryFrom<T>>::Error>[src]

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

fnvzip(self) -> V


[8]ページ先頭

©2009-2025 Movatter.jp