Struct TypeModelObject

Source
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

Source

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

Source

pub fn assign_primitive<'a, 'b, T>( &self, pipe: PipeDescriptor, path: &'a str, primitive: &'b mut Primitive<T>, validate_type: bool, ) -> bool
where 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 access
  • path: The path to the pipe
  • primitive: The primitive object
  • validate_type If we want to validate the type shape

Returns if the operation has sucessfully completed

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.