pub trait Loader<Context = ()>:
Send
+ Sync
+ SerializeDynwhere
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<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait { ... }
fn pitch<'life0, 'life1, 'async_trait>(
&'life0 self,
_loader_context: &'life1 mut LoaderContext<Context>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait { ... }
fn type(&self) -> Option<&str> { ... }
}Required Methods§
Sourcefn identifier(&self) -> Identifier
fn identifier(&self) -> Identifier
Returns the unique identifier for this loader
Provided Methods§
fn run<'life0, 'life1, 'async_trait>(
&'life0 self,
loader_context: &'life1 mut LoaderContext<Context>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn pitch<'life0, 'life1, 'async_trait>(
&'life0 self,
_loader_context: &'life1 mut LoaderContext<Context>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Trait Implementations§
Source§impl<Context> ArchiveUnsized for dyn Loader<Context>where
Context: Send,
impl<Context> ArchiveUnsized for dyn Loader<Context>where
Context: Send,
Source§type Archived = dyn DeserializeLoader<Context>
type Archived = dyn DeserializeLoader<Context>
The archived counterpart of this type. Unlike
Archive, it may be
unsized. Read moreSource§fn archived_metadata(
&self,
) -> <<dyn Loader<Context> as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
fn archived_metadata( &self, ) -> <<dyn Loader<Context> as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
Creates the archived version of the metadata for this value.
Source§impl<Context> LayoutRaw for dyn Loader<Context>where
Context: Send,
impl<Context> LayoutRaw for dyn Loader<Context>where
Context: Send,
Source§fn layout_raw(
metadata: <dyn Loader<Context> as Pointee>::Metadata,
) -> Result<Layout, LayoutError>
fn layout_raw( metadata: <dyn Loader<Context> as Pointee>::Metadata, ) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<Context> Pointee for dyn Loader<Context>where
Context: Send,
impl<Context> Pointee for dyn Loader<Context>where
Context: Send,
Source§type Metadata = DynMetadata<dyn Loader<Context>>
type Metadata = DynMetadata<dyn Loader<Context>>
The metadata type for pointers and references to this type.
Source§fn serialize_unsized(
&self,
serializer: &mut Strategy<Serializer<AlignedVec, ArenaHandle<'_>, Share>, Error>,
) -> Result<usize, Error>
fn serialize_unsized( &self, serializer: &mut Strategy<Serializer<AlignedVec, ArenaHandle<'_>, Share>, Error>, ) -> Result<usize, Error>
Writes the object and returns the position of the archived type.