pub struct Options { /* private fields */ }
Expand description
An Options is passed around when processing a set of query statements.
An Options contains specific information for how to process each particular statement, including the record version to retrieve, whether futures should be processed, and whether field/event/table queries should be processed (useful when importing data, where these queries might fail).
Implementations§
Source§impl Options
impl Options
Sourcepub fn set_ns(&mut self, ns: Option<Arc<str>>)
pub fn set_ns(&mut self, ns: Option<Arc<str>>)
Specify which Namespace should be used for
code which uses this Options
object.
Sourcepub fn set_db(&mut self, db: Option<Arc<str>>)
pub fn set_db(&mut self, db: Option<Arc<str>>)
Specify which Database should be used for
code which uses this Options
object.
Sourcepub fn with_max_computation_depth(self, depth: u32) -> Self
pub fn with_max_computation_depth(self, depth: u32) -> Self
Set the maximum depth a computation can reach.
Sourcepub fn with_id(self, id: Uuid) -> Self
pub fn with_id(self, id: Uuid) -> Self
Set the Node ID for subsequent code which uses
this Options
, with support for chaining.
Sourcepub fn with_ns(self, ns: Option<Arc<str>>) -> Self
pub fn with_ns(self, ns: Option<Arc<str>>) -> Self
Specify which Namespace should be used for code which
uses this Options
, with support for chaining.
Sourcepub fn with_db(self, db: Option<Arc<str>>) -> Self
pub fn with_db(self, db: Option<Arc<str>>) -> Self
Specify which Database should be used for code which
uses this Options
, with support for chaining.
Sourcepub fn with_auth(self, auth: Arc<Auth>) -> Self
pub fn with_auth(self, auth: Arc<Auth>) -> Self
Specify the authentication options for subsequent
code which uses this Options
, with chaining.
Sourcepub fn with_live(self, live: bool) -> Self
pub fn with_live(self, live: bool) -> Self
Specify whether live queries are supported for
code which uses this Options
, with chaining.
Sourcepub fn with_perms(self, perms: bool) -> Self
pub fn with_perms(self, perms: bool) -> Self
Specify whether permissions should be run for
code which uses this Options
, with chaining.
Sourcepub fn with_force(self, force: Force) -> Self
pub fn with_force(self, force: Force) -> Self
Specify wether tables/events should re-run
Sourcepub fn with_strict(self, strict: bool) -> Self
pub fn with_strict(self, strict: bool) -> Self
Sepecify if we should error when a table does not exist
Sourcepub fn with_import(self, import: bool) -> Self
pub fn with_import(self, import: bool) -> Self
Specify if we are currently importing data
Sourcepub fn set_import(&mut self, import: bool)
pub fn set_import(&mut self, import: bool)
Specify if we are currently importing data
Sourcepub fn with_futures(self, futures: bool) -> Self
pub fn with_futures(self, futures: bool) -> Self
Specify if we should process futures
pub fn set_futures(&mut self, futures: bool)
Sourcepub fn with_futures_never(self) -> Self
pub fn with_futures_never(self) -> Self
Specify if we should never process futures
Sourcepub fn set_futures_never(&mut self)
pub fn set_futures_never(&mut self)
Specify if we should never process futures
Sourcepub fn with_auth_enabled(self, auth_enabled: bool) -> Self
pub fn with_auth_enabled(self, auth_enabled: bool) -> Self
Create a new Options object with auth enabled
pub fn with_version(self, version: Option<u64>) -> Self
Sourcepub fn new_with_perms(&self, perms: bool) -> Self
pub fn new_with_perms(&self, perms: bool) -> Self
Create a new Options object for a subquery
Sourcepub fn new_with_force(&self, force: Force) -> Self
pub fn new_with_force(&self, force: Force) -> Self
Create a new Options object for a subquery
Sourcepub fn new_with_strict(&self, strict: bool) -> Self
pub fn new_with_strict(&self, strict: bool) -> Self
Create a new Options object for a subquery
Sourcepub fn new_with_import(&self, import: bool) -> Self
pub fn new_with_import(&self, import: bool) -> Self
Create a new Options object for a subquery
Sourcepub fn new_with_futures(&self, futures: bool) -> Self
pub fn new_with_futures(&self, futures: bool) -> Self
Create a new Options object for a subquery
Sourcepub fn new_with_sender(&self, sender: Sender<Notification>) -> Self
pub fn new_with_sender(&self, sender: Sender<Notification>) -> Self
Create a new Options object for a subquery
pub fn selected_base(&self) -> Result<Base, Error>
Sourcepub fn dive(&self, cost: u8) -> Result<Self, Error>
pub fn dive(&self, cost: u8) -> Result<Self, Error>
Create a new Options object for a function/subquery/future/etc.
The parameter is the approximate cost of the operation (more concretely, the size of the stack frame it uses relative to a simple function call). When in doubt, use a value of 1.
Sourcepub fn realtime(&self) -> Result<(), Error>
pub fn realtime(&self) -> Result<(), Error>
Check whether this request supports realtime queries
pub fn valid_for_ns(&self) -> Result<(), Error>
pub fn valid_for_db(&self) -> Result<(), Error>
Sourcepub fn is_allowed(
&self,
action: Action,
res: ResourceKind,
base: &Base,
) -> Result<(), Error>
pub fn is_allowed( &self, action: Action, res: ResourceKind, base: &Base, ) -> Result<(), Error>
Check if the current auth is allowed to perform an action on a given resource
Sourcepub fn check_perms(&self, action: Action) -> Result<bool, Error>
pub fn check_perms(&self, action: Action) -> Result<bool, Error>
Checks the current server configuration, and user authentication information to determine whether we need to process table permissions on each document.
This method is repeatedly called during the document processing operations, and so the performance of this function is important. We decided to bypass the system cedar auth system as a temporary solution until the new authorization system is optimised.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Options
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnwindSafe for Options
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more