pub enum RecordIdKey {
Number(i64),
String(String),
Uuid(Uuid),
Array(Array),
Object(Object),
Range(Box<RecordIdKeyRange>),
}Expand description
Represents a key component of a record identifier in SurrealDB
Record identifiers can have various types of keys including numbers, strings, UUIDs, arrays, objects, or ranges. This enum provides type-safe representation for all key types.
Variants§
Number(i64)
A numeric key
String(String)
A string key
Uuid(Uuid)
A UUID key
Array(Array)
An array key
Object(Object)
An object key
Range(Box<RecordIdKeyRange>)
A range key
Implementations§
Source§impl RecordIdKey
impl RecordIdKey
Sourcepub fn rand() -> RecordIdKey
pub fn rand() -> RecordIdKey
Generate a new random ID
Sourcepub fn ulid() -> RecordIdKey
pub fn ulid() -> RecordIdKey
Generate a new random ULID
Sourcepub fn uuid() -> RecordIdKey
pub fn uuid() -> RecordIdKey
Generate a new random UUID
Trait Implementations§
Source§impl Clone for RecordIdKey
impl Clone for RecordIdKey
Source§fn clone(&self) -> RecordIdKey
fn clone(&self) -> RecordIdKey
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 moreSource§impl Debug for RecordIdKey
impl Debug for RecordIdKey
Source§impl<'de> Deserialize<'de> for RecordIdKey
impl<'de> Deserialize<'de> for RecordIdKey
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RecordIdKey, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<RecordIdKey, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&str> for RecordIdKey
impl From<&str> for RecordIdKey
Source§fn from(value: &str) -> RecordIdKey
fn from(value: &str) -> RecordIdKey
Converts to this type from the input type.
Source§impl From<Array> for RecordIdKey
impl From<Array> for RecordIdKey
Source§fn from(value: Array) -> RecordIdKey
fn from(value: Array) -> RecordIdKey
Converts to this type from the input type.
Source§impl From<Box<RecordIdKeyRange>> for RecordIdKey
impl From<Box<RecordIdKeyRange>> for RecordIdKey
Source§fn from(value: Box<RecordIdKeyRange>) -> RecordIdKey
fn from(value: Box<RecordIdKeyRange>) -> RecordIdKey
Converts to this type from the input type.
Source§impl From<Object> for RecordIdKey
impl From<Object> for RecordIdKey
Source§fn from(value: Object) -> RecordIdKey
fn from(value: Object) -> RecordIdKey
Converts to this type from the input type.
Source§impl From<RecordIdKeyRange> for RecordIdKey
impl From<RecordIdKeyRange> for RecordIdKey
Source§fn from(value: RecordIdKeyRange) -> RecordIdKey
fn from(value: RecordIdKeyRange) -> RecordIdKey
Converts to this type from the input type.
Source§impl From<String> for RecordIdKey
impl From<String> for RecordIdKey
Source§fn from(value: String) -> RecordIdKey
fn from(value: String) -> RecordIdKey
Converts to this type from the input type.
Source§impl From<Uuid> for RecordIdKey
impl From<Uuid> for RecordIdKey
Source§fn from(value: Uuid) -> RecordIdKey
fn from(value: Uuid) -> RecordIdKey
Converts to this type from the input type.
Source§impl From<i64> for RecordIdKey
impl From<i64> for RecordIdKey
Source§fn from(value: i64) -> RecordIdKey
fn from(value: i64) -> RecordIdKey
Converts to this type from the input type.
Source§impl FromFlatbuffers for RecordIdKey
impl FromFlatbuffers for RecordIdKey
Source§type Input<'a> = RecordIdKey<'a>
type Input<'a> = RecordIdKey<'a>
The input type from the flatbuffers builder
Source§fn from_fb(
input: <RecordIdKey as FromFlatbuffers>::Input<'_>,
) -> Result<RecordIdKey, Error>
fn from_fb( input: <RecordIdKey as FromFlatbuffers>::Input<'_>, ) -> Result<RecordIdKey, Error>
Convert a flatbuffers builder type to a type.
Source§impl Hash for RecordIdKey
impl Hash for RecordIdKey
Source§impl Ord for RecordIdKey
impl Ord for RecordIdKey
Source§fn cmp(&self, other: &RecordIdKey) -> Ordering
fn cmp(&self, other: &RecordIdKey) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq<Value> for RecordIdKey
impl PartialEq<Value> for RecordIdKey
Source§impl PartialEq for RecordIdKey
impl PartialEq for RecordIdKey
Source§impl PartialOrd for RecordIdKey
impl PartialOrd for RecordIdKey
Source§impl Serialize for RecordIdKey
impl Serialize for RecordIdKey
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl SurrealValue for RecordIdKey
impl SurrealValue for RecordIdKey
Source§fn into_value(self) -> Value
fn into_value(self) -> Value
Converts this type into a SurrealDB value
Source§fn from_value(value: Value) -> Result<RecordIdKey, Error>
fn from_value(value: Value) -> Result<RecordIdKey, Error>
Attempts to convert a SurrealDB value into this type
Source§impl ToFlatbuffers for RecordIdKey
impl ToFlatbuffers for RecordIdKey
Source§type Output<'bldr> = WIPOffset<RecordIdKey<'bldr>>
type Output<'bldr> = WIPOffset<RecordIdKey<'bldr>>
The output type for the flatbuffers builder
Source§fn to_fb<'bldr>(
&self,
builder: &mut FlatBufferBuilder<'bldr>,
) -> Result<<RecordIdKey as ToFlatbuffers>::Output<'bldr>, Error>
fn to_fb<'bldr>( &self, builder: &mut FlatBufferBuilder<'bldr>, ) -> Result<<RecordIdKey as ToFlatbuffers>::Output<'bldr>, Error>
Convert the type to a flatbuffers builder type.
Source§impl ToSql for RecordIdKey
impl ToSql for RecordIdKey
impl Eq for RecordIdKey
impl StructuralPartialEq for RecordIdKey
Auto Trait Implementations§
impl Freeze for RecordIdKey
impl RefUnwindSafe for RecordIdKey
impl Send for RecordIdKey
impl Sync for RecordIdKey
impl Unpin for RecordIdKey
impl UnsafeUnpin for RecordIdKey
impl UnwindSafe for RecordIdKey
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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