#[non_exhaustive]pub enum Resource {
Table(String),
RecordId(RecordId),
Object(Object),
Array(Vec<Value>),
Edge(Edge),
Range(QueryRange),
Unspecified,
}
Expand description
A database resource
A resource is a location, or a range of locations, from which data can be fetched.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Table(String)
Table name
RecordId(RecordId)
Record ID
Object(Object)
An object
Array(Vec<Value>)
An array
Edge(Edge)
Edges
Range(QueryRange)
A range of id’s on a table.
Unspecified
Unspecified resource
Implementations§
Source§impl Resource
impl Resource
Sourcepub fn with_range(self, range: KeyRange) -> Result<Self>
pub fn with_range(self, range: KeyRange) -> Result<Self>
Add a range to the resource, this only works if the resource is a table.
pub fn is_single_recordid(&self) -> bool
Trait Implementations§
Source§impl CreateResource<Value> for Resource
impl CreateResource<Value> for Resource
fn into_resource(self) -> Result<Resource>
Source§impl From<QueryRange> for Resource
impl From<QueryRange> for Resource
Source§fn from(value: QueryRange) -> Self
fn from(value: QueryRange) -> Self
Converts to this type from the input type.
Source§impl IntoResource<Value> for Resource
impl IntoResource<Value> for Resource
fn into_resource(self) -> Result<Resource>
impl StructuralPartialEq for Resource
Auto Trait Implementations§
impl Freeze for Resource
impl RefUnwindSafe for Resource
impl Send for Resource
impl Sync for Resource
impl Unpin for Resource
impl UnwindSafe for Resource
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
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>
Converts
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>
Converts
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