pub struct Resource<K: ResourceKind> { /* private fields */ }
Expand description
An opaque resource of kind K
, for erasing the resource’s type.
The resource can later be resolved with a ResourceResolver
.
Implementations§
Source§impl<K: ResourceKind> Resource<K>
impl<K: ResourceKind> Resource<K>
Sourcepub fn new<T: 'static + ResourceId<K> + MeshPayload + Send>(value: T) -> Self
pub fn new<T: 'static + ResourceId<K> + MeshPayload + Send>(value: T) -> Self
Wraps value
as an opaque resource.
Trait Implementations§
Source§impl<K: ResourceKind> Debug for Resource<K>
impl<K: ResourceKind> Debug for Resource<K>
Source§impl<K: ResourceKind> DefaultEncoding for Resource<K>
impl<K: ResourceKind> DefaultEncoding for Resource<K>
Source§type Encoding = TableEncoder
type Encoding = TableEncoder
The encoding to use for the serialization. Read more
Source§impl<'encoding, K: ResourceKind> StructDecodeMetadata<'encoding, Resource> for Resource<K>
impl<'encoding, K: ResourceKind> StructDecodeMetadata<'encoding, Resource> for Resource<K>
Source§const DECODERS: &'static [ErasedDecoderEntry] = _
const DECODERS: &'static [ErasedDecoderEntry] = _
The list of decoder vtables.
Source§impl<K: ResourceKind> StructEncodeMetadata<Resource> for Resource<K>
impl<K: ResourceKind> StructEncodeMetadata<Resource> for Resource<K>
Source§const ENCODERS: &'static [ErasedEncoderEntry] = _
const ENCODERS: &'static [ErasedEncoderEntry] = _
The list of encoder vtables.
Auto Trait Implementations§
impl<K> Freeze for Resource<K>
impl<K> !RefUnwindSafe for Resource<K>
impl<K> Send for Resource<K>
impl<K> !Sync for Resource<K>
impl<K> Unpin for Resource<K>
impl<K> !UnwindSafe for Resource<K>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> SerializeMessage for Twhere
T: 'static + MeshPayload + Send,
impl<T> SerializeMessage for Twhere
T: 'static + MeshPayload + Send,
Source§fn compute_message_size(&mut self, sizer: MessageSizer<'_>)
fn compute_message_size(&mut self, sizer: MessageSizer<'_>)
Computes the message size, as in
MessageEncode::compute_message_size
.Source§fn write_message(self, writer: MessageWriter<'_, '_, Resource>)
fn write_message(self, writer: MessageWriter<'_, '_, Resource>)
Writes the message, as in
MessageEncode::write_message
.Source§fn extract(self) -> <T as SerializeMessage>::Concrete
fn extract(self) -> <T as SerializeMessage>::Concrete
Extract the concrete message.