Struct oc2_hlapi::device::FileImportExportCard

source ·
pub struct FileImportExportCard(/* private fields */);
Expand description

A device that allows importing and exporting of files from the player’s computer.

Trait Implementations§

source§

impl FileImportExportInterface for FileImportExportCard

source§

fn request_import_file(&self) -> Result<bool>

Requests the start of a file import, returning true if a file can be imported.
source§

fn begin_import_file(&self) -> Result<Option<ImportFileInfo>>

Prompts the player to select a file to import, returning the information for the file requested. This method should be called in a loop, as it may return None before eventually returning the file information.
source§

fn read_import_file(&self) -> Result<Option<Vec<u8>>>

Reads a portion of the file currently being imported. Returns a slice of bytes containing the portion of the file that has been read. Returns None when the file has been fully imported. If the byte slice is empty, it means that the device is not ready to import the file.
source§

fn begin_export_file(&self, name: &str) -> Result<()>

Prompts the user to select a path where a file with the given name should be exported.
source§

fn write_export_file(&self, data: &[u8]) -> Result<()>

Writes some data to the current file being exported.
source§

fn finish_export_file(&self) -> Result<()>

Finishes the currently running file export operation.
source§

fn reset(&self) -> Result<()>

Resets the device’s state, preparing it for another file import or export operation.
source§

impl RpcDevice for FileImportExportCard

source§

const IDENTIFIER: &'static str = "file_import_export"

source§

fn new(id: Uuid, bus: &DeviceBus) -> Self

source§

fn id(&self) -> Uuid

source§

fn bus(&self) -> &DeviceBus

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>,

§

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>,

§

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.