[−][src]Struct sgx_serialize::SerializeHelper
SerializeHelper make it easy to obtain serialize function.
Methods
impl SerializeHelper
[src]
pub fn new() -> SerializeHelper
[src]
Create a new instance of SerializeHelper
let helper = SerializeHelper::new();
pub fn get_size(&self) -> usize
[src]
Get the size of the serialized buffer of the target.
impl SerializeHelper
[src]
pub fn encode<E: Serializable>(&self, target: E) -> Option<Vec<u8>>
[src]
Use encode to serialize a target type. The target must impl the tarit Serializable.
The function return a Option::Some of Vec<u8>
, if something error, return Option::None.
#[derive(Serializable, DeSerializable)] struct TestSturct { a1: u32, a2: u32, } let a = TestEnum::EnumStruct {a1: 2017, a2:829}; let helper = SerializeHelper::new(); let data = helper.encode(a).unwrap();
Auto Trait Implementations
impl Send for SerializeHelper
impl !Sync for SerializeHelper
Blanket Implementations
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,