pub struct Record(/* private fields */);Expand description
A Scheme record type. Effectively a tuple of a fixed size array and some type information.
Implementations§
Source§impl Record
impl Record
pub fn rtd(&self) -> Arc<RecordTypeDescriptor>
Sourcepub fn from_rust_type<T: SchemeCompatible>(t: T) -> Self
pub fn from_rust_type<T: SchemeCompatible>(t: T) -> Self
Convert any Rust type that implements SchemeCompatible into an opaque record.
Sourcepub fn cast<T: SchemeCompatible>(&self) -> Option<Gc<T>>
pub fn cast<T: SchemeCompatible>(&self) -> Option<Gc<T>>
Attempt to convert the record into a Rust type that implements SchemeCompatible.
Sourcepub fn get_parent_field(
&self,
rtd: &Arc<RecordTypeDescriptor>,
k: usize,
) -> Result<Value, Exception>
pub fn get_parent_field( &self, rtd: &Arc<RecordTypeDescriptor>, k: usize, ) -> Result<Value, Exception>
Get the kth field of a parent Record
Sourcepub fn set_field(&self, k: usize, new_value: Value) -> Result<(), Exception>
pub fn set_field(&self, k: usize, new_value: Value) -> Result<(), Exception>
Set the kth field of the Record
Sourcepub fn set_parent_field(
&self,
rtd: &Arc<RecordTypeDescriptor>,
k: usize,
new_value: Value,
) -> Result<(), Exception>
pub fn set_parent_field( &self, rtd: &Arc<RecordTypeDescriptor>, k: usize, new_value: Value, ) -> Result<(), Exception>
Set the kth field of a parent Record
Trait Implementations§
Source§impl From<Record> for UnpackedValue
impl From<Record> for UnpackedValue
Source§impl TryFrom<UnpackedValue> for Record
impl TryFrom<UnpackedValue> for Record
Auto Trait Implementations§
impl Freeze for Record
impl !RefUnwindSafe for Record
impl Send for Record
impl Sync for Record
impl !Unpin for Record
impl !UnwindSafe for Record
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> 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