ISequentialStreamVtbl

Struct ISequentialStreamVtbl 

Source
#[repr(C)]
pub struct ISequentialStreamVtbl { pub QueryInterface: unsafe extern "system" fn(this: *mut ISequentialStream, itf_type: *const IID, itf: *mut *mut void) -> HRESULT, pub AddRef: unsafe extern "system" fn(this: *mut ISequentialStream) -> u32, pub Release: unsafe extern "system" fn(this: *mut ISequentialStream) -> u32, pub Read: unsafe extern "system" fn(this: *mut ISequentialStream, buf: *mut void, len: u64, read: *mut u64) -> HRESULT, pub Write: unsafe extern "system" fn(this: *mut ISequentialStream, buf: *const void, len: u64, written: *mut u64) -> HRESULT, }
Expand description

Vtable for interface ISequentialStream.

This is the table of function pointers corresponding to an object’s implementation of this interface. To generate this for a type implementing trait ISequentialStreamImpl, see ISequentialStreamVtbl::dispatch.

Fields§

§QueryInterface: unsafe extern "system" fn(this: *mut ISequentialStream, itf_type: *const IID, itf: *mut *mut void) -> HRESULT

Function ISequentialStream::QueryInterface. Inherited from IUnknown.

§AddRef: unsafe extern "system" fn(this: *mut ISequentialStream) -> u32

Function ISequentialStream::AddRef. Inherited from IUnknown.

§Release: unsafe extern "system" fn(this: *mut ISequentialStream) -> u32

Function ISequentialStream::Release. Inherited from IUnknown.

§Read: unsafe extern "system" fn(this: *mut ISequentialStream, buf: *mut void, len: u64, read: *mut u64) -> HRESULT

Function ISequentialStream::Read.

§Write: unsafe extern "system" fn(this: *mut ISequentialStream, buf: *const void, len: u64, written: *mut u64) -> HRESULT

Function ISequentialStream::Write.

Implementations§

Source§

impl ISequentialStreamVtbl

Source

pub const fn dispatch<const OFFSET: usize, T: ISequentialStreamImpl>() -> &'static ISequentialStreamVtbl

Creates a ISequentialStream vtable for T with the specified OFFSET.

COM interface methods in a vtable receive the pointer to the vtable as their first parameter. This pointer may not necessarily correspond with the pointer to the actual T struct (for example, when it contains more than one vtable). This is why the functions in the vtable returned by this function may need to offset the pointer to get the real address for self to call the ISequentialStreamImpl functions with.

This is what the OFFSET parameter is for: it specifies the offset of the generated vtable in struct T in multiples of the platform pointer size. Effectively, this means for a struct with multiple vtables, the first field would have OFFSET = 0, the second OFFSET = 1, and so on. This is why, when using this function, vtable pointers must only be preceded by other vtable pointers in the struct definition.

Also see nucomcore::decl_class_vtable for generating a class vtable without having to manually specify the offset.

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.