Struct magnus::r_typed_data::DataTypeBuilder
source · pub struct DataTypeBuilder<T> { /* private fields */ }
Expand description
A builder for DataType
.
Implementations§
source§impl<T> DataTypeBuilder<T>where
T: DataTypeFunctions,
impl<T> DataTypeBuilder<T>where
T: DataTypeFunctions,
sourcepub fn new(name: &'static str) -> Self
pub fn new(name: &'static str) -> Self
Create a new DataTypeBuilder
.
name
should be unique per wrapped type. It does not need to be a
valid Ruby identifier.
sourcepub fn free_immediately(&mut self)
pub fn free_immediately(&mut self)
Enable the ‘free_immediately’ flag.
This is safe to do as long as the <T as DataTypeFunctions>::free
function or T
’s drop function don’t call Ruby in any way.
If safe this should be enabled as this performs better and is more memory efficient.
sourcepub fn wb_protected(&mut self)
pub fn wb_protected(&mut self)
Enable the ‘write barrier protected’ flag.
You almost certainly don’t want to enable this.
Enable the ‘frozen_shareable’ flag.
Set this if your type is thread safe when the Ruby wrapper object is frozen.