pub struct TypeModelObject { /* private fields */ }
Expand description
The object wrapper for a type model.
A type model is the container of the protocol data request used by the servlet. For Rust servlet, the type model is created automatically by the servet loader and will be disposed after the servlet is dead.
Owning the data object doesn’t own the type model itself. There’s no way for Rust code to get the owership of the internal type model.
Implementations§
Source§impl TypeModelObject
impl TypeModelObject
Sourcepub fn from_raw(raw: *mut c_void) -> Option<TypeModelObject>
pub fn from_raw(raw: *mut c_void) -> Option<TypeModelObject>
Create a new type model wrapper object form the raw pointer
This function is desgined to be called inside the export_bootstrap!
macro, be awrared if
you feel you have to use this.
raw
: The raw pointer to wrap
Returns the newly created wrapper object or None
Sourcepub fn assign_primitive<'a, 'b, T>(
&self,
pipe: PipeDescriptor,
path: &'a str,
primitive: &'b mut Primitive<T>,
validate_type: bool,
) -> boolwhere
T: PrimitiveTypeTag<T> + Default,
pub fn assign_primitive<'a, 'b, T>(
&self,
pipe: PipeDescriptor,
path: &'a str,
primitive: &'b mut Primitive<T>,
validate_type: bool,
) -> boolwhere
T: PrimitiveTypeTag<T> + Default,
Assign a primitive data object to the type model. This will cause the Plumber framework check the protocol database and keep the type information in the primitive object for further protocol parsing
pipe
: The pipe we want to accesspath
: The path to the pipeprimitive
: The primitive objectvalidate_type
If we want to validate the type shape
Returns if the operation has sucessfully completed