Trait Resource

Source
pub trait Resource:
    Sized
    + Display
    + KustosFromStr {
    const PREFIX: &'static str;

    // Provided method
    fn resource_id(&self) -> ResourceId { ... }
}
Expand description

This trait is used to allow the retrieval of resource reduced URL prefixes as well as retrieving the reduced URL

Required Associated Constants§

Source

const PREFIX: &'static str

URI prefix of the ID of this resource

§Example
  • /rooms/
  • /users/

Provided Methods§

Source

fn resource_id(&self) -> ResourceId

Returns path part of the URL to access this specific resource

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§