pub struct NdrEncoder { /* private fields */ }Expand description
Serializer. Alignment is relative to the start of the stub buffer.
Implementations§
Source§impl NdrEncoder
impl NdrEncoder
pub fn new() -> Self
Sourcepub fn align(&mut self, a: usize)
pub fn align(&mut self, a: usize)
Pad with zero bytes up to an a-byte boundary. Public so callers can align a union
arm or struct to its natural alignment (NDR aligns an aggregate to its largest member).
pub fn u8(&mut self, v: u8)
pub fn u16(&mut self, v: u16)
pub fn u32(&mut self, v: u32)
pub fn u64(&mut self, v: u64)
pub fn bytes(&mut self, b: &[u8])
Sourcepub fn uuid(&mut self, b: &[u8; 16])
pub fn uuid(&mut self, b: &[u8; 16])
A UUID / GUID field (DCE wire layout, 16 bytes, aligned to 4).
Sourcepub fn referent(&mut self) -> u32
pub fn referent(&mut self) -> u32
A non-null unique pointer: emit a fresh referent id. Caller emits the pointee next.
pub fn null_ptr(&mut self)
Sourcepub fn conformant_varying_wstr(&mut self, s: &str)
pub fn conformant_varying_wstr(&mut self, s: &str)
A conformant+varying wide string: max_count, offset(0), actual_count, then UTF-16LE
including the terminating NUL. Matches the [size_is][length_is] wchar payload.
pub fn into_bytes(self) -> Vec<u8> ⓘ
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Default for NdrEncoder
impl Default for NdrEncoder
Source§fn default() -> NdrEncoder
fn default() -> NdrEncoder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for NdrEncoder
impl RefUnwindSafe for NdrEncoder
impl Send for NdrEncoder
impl Sync for NdrEncoder
impl Unpin for NdrEncoder
impl UnsafeUnpin for NdrEncoder
impl UnwindSafe for NdrEncoder
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