Skip to main content

Resource

Trait Resource 

Source
pub trait Resource: Sized + 'static {
    type Rep: ResourceRep<Self>;
}
Expand description

A trait implemented by all resources that a component might export.

This is an implementation detail primarily for the code generated by exported resources. The primary purpose of this trait is to serve as an abstraction for the in-memory storage of a resource.

Required Associated Types§

Source

type Rep: ResourceRep<Self>

The type which is actually stored in-memory for this resource.

By default this is Option<T>.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T: 'static> Resource for T