ImporterFFI

Struct ImporterFFI 

Source
#[repr(C)]
pub struct ImporterFFI { /* private fields */ }

Implementations§

Source§

impl ImporterFFI

Source

pub fn new<'a, I>( importer: &'static I, name: &str, format: &str, target: &str, extensions: &[&'a str], ) -> Self
where I: Importer,

Source

pub fn name(&self) -> Result<&str, Utf8Error>

Source

pub fn name_lossy(&self) -> Cow<'_, str>

Source

pub fn format(&self) -> Result<&str, Utf8Error>

Source

pub fn target(&self) -> Result<&str, Utf8Error>

Source

pub fn extensions(&self) -> impl Iterator<Item = Result<&str, Utf8Error>>

Source

pub fn import<'a, S, D>( &self, source: &Path, output: &Path, sources: &mut S, dependencies: &mut D, ) -> Result<(), ImportError>
where S: FnMut(&str) -> Option<&'a Path> + 'a, D: FnMut(&str, &str) -> Option<AssetId>,

Trait Implementations§

Source§

impl Send for ImporterFFI

Exporting non thread-safe importers breaks the contract of the FFI. The potential unsoundness is covered by load_dylib_importers unsafety. There is no way to guarantee that dynamic library will uphold the contract, making load_dylib_importers inevitably unsound.

Source§

impl Sync for ImporterFFI

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.