pub struct PacketWrapper { /* private fields */ }Expand description
PacketWrapper contains a supplier that generates a packet instance with Vector parameters
Implementations§
Source§impl PacketWrapper
Default PacketWrapper Implementation
impl PacketWrapper
Default PacketWrapper Implementation
Sourcepub fn new(
fields_accessor: Option<Box<dyn Fn() -> Vec<&'static str> + Send + Sync>>,
instance_accessor: Option<Box<dyn Fn(Vec<Box<dyn Any>>) -> Box<dyn Packet + Send + Sync> + Send + Sync>>,
types_accessor: Option<Box<dyn Fn() -> Vec<&'static str> + Send + Sync>>,
) -> Self
pub fn new( fields_accessor: Option<Box<dyn Fn() -> Vec<&'static str> + Send + Sync>>, instance_accessor: Option<Box<dyn Fn(Vec<Box<dyn Any>>) -> Box<dyn Packet + Send + Sync> + Send + Sync>>, types_accessor: Option<Box<dyn Fn() -> Vec<&'static str> + Send + Sync>>, ) -> Self
Creates a new wrapper instance
Sourcepub fn create_instance<T: Packet + Clone + Send + Sync + 'static>(
&self,
data: Vec<Box<dyn Any>>,
) -> T
pub fn create_instance<T: Packet + Clone + Send + Sync + 'static>( &self, data: Vec<Box<dyn Any>>, ) -> T
Generate instance with the supplier
pub fn create_instance_box( &self, data: Vec<Box<dyn Any>>, ) -> Box<dyn Packet + Send + Sync>
Sourcepub fn get_fields(&self) -> Vec<&'static str>
pub fn get_fields(&self) -> Vec<&'static str>
Get the field names with the supplier
Auto Trait Implementations§
impl Freeze for PacketWrapper
impl !RefUnwindSafe for PacketWrapper
impl Send for PacketWrapper
impl Sync for PacketWrapper
impl Unpin for PacketWrapper
impl !UnwindSafe for PacketWrapper
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