pub trait Query<'conn>: Sized {
// Required methods
fn execute<'mcx>(
self,
client: &SpiClient<'conn>,
limit: Option<c_long>,
args: &[DatumWithOid<'mcx>],
) -> SpiResult<SpiTupleTable<'conn>>;
fn try_open_cursor<'mcx>(
self,
client: &SpiClient<'conn>,
args: &[DatumWithOid<'mcx>],
) -> SpiResult<SpiCursor<'conn>>;
// Provided method
fn open_cursor<'mcx>(
self,
client: &SpiClient<'conn>,
args: &[DatumWithOid<'mcx>],
) -> SpiCursor<'conn> { ... }
}
Expand description
A generalized interface to what constitutes a query
Its primary purpose is to abstract away differences between one-off statements and prepared statements, but it can potentially be implemented for other types, provided they can be converted into a query.
Required Methods§
Sourcefn execute<'mcx>(
self,
client: &SpiClient<'conn>,
limit: Option<c_long>,
args: &[DatumWithOid<'mcx>],
) -> SpiResult<SpiTupleTable<'conn>>
fn execute<'mcx>( self, client: &SpiClient<'conn>, limit: Option<c_long>, args: &[DatumWithOid<'mcx>], ) -> SpiResult<SpiTupleTable<'conn>>
Execute a query given a client and other arguments.
Sourcefn try_open_cursor<'mcx>(
self,
client: &SpiClient<'conn>,
args: &[DatumWithOid<'mcx>],
) -> SpiResult<SpiCursor<'conn>>
fn try_open_cursor<'mcx>( self, client: &SpiClient<'conn>, args: &[DatumWithOid<'mcx>], ) -> SpiResult<SpiCursor<'conn>>
Tries to open cursor for the query.
Provided Methods§
Sourcefn open_cursor<'mcx>(
self,
client: &SpiClient<'conn>,
args: &[DatumWithOid<'mcx>],
) -> SpiCursor<'conn>
👎Deprecated since 0.12.2: undefined behavior
fn open_cursor<'mcx>( self, client: &SpiClient<'conn>, args: &[DatumWithOid<'mcx>], ) -> SpiCursor<'conn>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.