pub struct QueryGuard { /* private fields */ }Expand description
Security wrapper for query execution
Implementations§
Source§impl QueryGuard
impl QueryGuard
Sourcepub const fn new(
timeout: Duration,
schema_filter: SchemaFilter,
row_limit: Option<NonZeroU32>,
) -> Self
pub const fn new( timeout: Duration, schema_filter: SchemaFilter, row_limit: Option<NonZeroU32>, ) -> Self
Create a new query guard with security settings
Sourcepub const fn row_limit(&self) -> Option<NonZeroU32>
pub const fn row_limit(&self) -> Option<NonZeroU32>
Get the configured row limit
Sourcepub async fn execute<F, T, E>(&self, query_fn: F) -> Result<T, Error>
pub async fn execute<F, T, E>(&self, query_fn: F) -> Result<T, Error>
Execute a query function with timeout
Sourcepub async fn execute_with_error<F, T, E>(
&self,
query_fn: F,
) -> Result<T, ExecuteError<E>>
pub async fn execute_with_error<F, T, E>( &self, query_fn: F, ) -> Result<T, ExecuteError<E>>
Execute a query function with timeout, returning the raw error type
Trait Implementations§
Source§impl Clone for QueryGuard
impl Clone for QueryGuard
Source§fn clone(&self) -> QueryGuard
fn clone(&self) -> QueryGuard
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for QueryGuard
impl RefUnwindSafe for QueryGuard
impl Send for QueryGuard
impl Sync for QueryGuard
impl Unpin for QueryGuard
impl UnsafeUnpin for QueryGuard
impl UnwindSafe for QueryGuard
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more