pub enum EntityRef<'a> {
Id(EntityId),
Record {
data_source: &'a str,
record_id: &'a str,
},
}Expand description
Reference to an entity - either by direct ID or by record key.
This enum allows functions to accept either an entity ID or a record identifier (data source + record ID) to refer to an entity.
§Examples
use sz_rust_sdk::prelude::*;
// Reference by entity ID (automatic conversion)
let entity_id: EntityId = 1001;
let ref1: EntityRef = entity_id.into();
// Reference by record key
let ref2 = EntityRef::Record {
data_source: "CUSTOMERS",
record_id: "CUST001",
};Variants§
Id(EntityId)
Entity identified by its entity ID
Record
Entity identified by a record’s data source and record ID
Implementations§
Trait Implementations§
impl<'a> Eq for EntityRef<'a>
impl<'a> StructuralPartialEq for EntityRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for EntityRef<'a>
impl<'a> RefUnwindSafe for EntityRef<'a>
impl<'a> Send for EntityRef<'a>
impl<'a> Sync for EntityRef<'a>
impl<'a> Unpin for EntityRef<'a>
impl<'a> UnwindSafe for EntityRef<'a>
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more