Struct AsyncReadInfo

Source
pub struct AsyncReadInfo { /* private fields */ }
Expand description

Information about a single asynchronous file operation.

Implementations§

Source§

impl AsyncReadInfo

Source

pub fn handle(&self) -> *mut c_void

File handle that was returned in FileSystem::open.

Source

pub fn offset(&self) -> c_uint

Offset within the file where the read operation should occur.

Source

pub fn size(&self) -> c_uint

Number of bytes to read.

Source

pub fn priority(&self) -> c_int

Priority hint for how quickly this operation should be serviced where 0 represents low importance and 100 represents extreme importance. This could be used to prioritize the read order of a file job queue for example. FMOD decides the importance of the read based on if it could degrade audio or not.

Source

pub fn userdata(&self) -> *mut c_void

User value associated with this async operation, passed to FileSystemAsync::cancel.

Source

pub unsafe fn set_userdata(&mut self, userdata: *mut c_void)

Set the user value associated with this async operation.

§Safety

You cannot call this while a AsyncCancelInfo with the same raw pointer is live.

Source

pub fn raw(&self) -> *mut FMOD_ASYNCREADINFO

Get the raw pointer associated with this AsyncReadInfo.

Source

pub fn written(&self) -> c_uint

Number of bytes currently read.

Source

pub fn buffer(&mut self) -> FileBuffer<'_>

Get the FileBuffer associated with this AsyncReadInfo.

Source

pub unsafe fn finish(self, result: Result<()>)

Signal the async read is done.

If AsyncReadInfo::written != AsyncReadInfo::size this function will send an Error::FileEof for you.

§Safety

If you have a AsyncCancelInfo with the same raw pointer, it is immediately invalid after calling this function.

Trait Implementations§

Source§

impl Debug for AsyncReadInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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.