pub struct RecordId {
pub table: String,
pub id: RecordIdValue,
}Expand description
Represents a SurrealDB record ID
Fields§
§table: String§id: RecordIdValueImplementations§
Source§impl RecordId
impl RecordId
Sourcepub fn new(table: impl Into<String>, id: impl Into<RecordIdValue>) -> Self
pub fn new(table: impl Into<String>, id: impl Into<RecordIdValue>) -> Self
Create a new record ID
Sourcepub fn string(table: impl Into<String>, id: impl Into<String>) -> Self
pub fn string(table: impl Into<String>, id: impl Into<String>) -> Self
Create a record ID with a string ID
Sourcepub fn object(table: impl Into<String>, id: Value) -> Self
pub fn object(table: impl Into<String>, id: Value) -> Self
Create a record ID with an object ID
Sourcepub fn array(table: impl Into<String>, id: Vec<Value>) -> Self
pub fn array(table: impl Into<String>, id: Vec<Value>) -> Self
Create a record ID with an array ID
Sourcepub fn parse(input: &str) -> Result<Self, RecordParseError>
pub fn parse(input: &str) -> Result<Self, RecordParseError>
Parse a record ID from a string format “table:id”
Sourcepub fn id(&self) -> &RecordIdValue
pub fn id(&self) -> &RecordIdValue
Get the ID value
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RecordId
impl<'de> Deserialize<'de> for RecordId
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for RecordId
impl StructuralPartialEq for RecordId
Auto Trait Implementations§
impl Freeze for RecordId
impl RefUnwindSafe for RecordId
impl Send for RecordId
impl Sync for RecordId
impl Unpin for RecordId
impl UnsafeUnpin for RecordId
impl UnwindSafe for RecordId
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> Equivalent<K> for Q
impl<Q, K> Equivalent<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.