Skip to main content

ResourceType

Trait ResourceType 

Source
pub trait ResourceType: FromStr {
    // Required method
    fn resource_type() -> &'static str;

    // Provided method
    fn new(name: &str, package: Option<String>) -> Resource<Self> { ... }
}
Expand description

Trait implemented by types that can be used as resource.

Required Methods§

Source

fn resource_type() -> &'static str

Returns string representation of the resource_type.

Provided Methods§

Source

fn new(name: &str, package: Option<String>) -> Resource<Self>

Creates new instance of Resource.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§