Loader

Trait Loader 

Source
pub trait Loader<Context = ()>:
    Send
    + Sync
    + SerializeDyn
where Context: Send,
{ // Required method fn identifier(&self) -> Identifier; // Provided methods fn run<'life0, 'life1, 'async_trait>( &'life0 self, loader_context: &'life1 mut LoaderContext<Context>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn pitch<'life0, 'life1, 'async_trait>( &'life0 self, _loader_context: &'life1 mut LoaderContext<Context>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn type(&self) -> Option<&str> { ... } }

Required Methods§

Source

fn identifier(&self) -> Identifier

Returns the unique identifier for this loader

Provided Methods§

Source

fn run<'life0, 'life1, 'async_trait>( &'life0 self, loader_context: &'life1 mut LoaderContext<Context>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn pitch<'life0, 'life1, 'async_trait>( &'life0 self, _loader_context: &'life1 mut LoaderContext<Context>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn type(&self) -> Option<&str>

Returns the loader type based on the module’s package.json type field or file extension. This affects how the loader context interprets the module (e.g., “commonjs”, “module”).

Trait Implementations§

Source§

impl<Context> ArchiveUnsized for dyn Loader<Context>
where Context: Send,

Source§

type Archived = dyn DeserializeLoader<Context>

The archived counterpart of this type. Unlike Archive, it may be unsized. Read more
Source§

fn archived_metadata(&self) -> ArchivedMetadata<Self>

Creates the archived version of the metadata for this value.
Source§

impl<Context> LayoutRaw for dyn Loader<Context>
where Context: Send,

Source§

fn layout_raw( metadata: <Self as Pointee>::Metadata, ) -> Result<Layout, LayoutError>

Returns the layout of the type.
Source§

impl<Context> Pointee for dyn Loader<Context>
where Context: Send,

Source§

type Metadata = DynMetadata<dyn Loader<Context>>

The metadata type for pointers and references to this type.
Source§

impl<Context> SerializeUnsized<Strategy<Serializer<AlignedVec, ArenaHandle<'_>, Share>, Error>> for dyn Loader<Context>
where Context: Send,

Source§

fn serialize_unsized( &self, serializer: &mut Serializer<'_>, ) -> Result<usize, Error>

Writes the object and returns the position of the archived type.

Implementors§