Trait restson::RestPath

source ·
pub trait RestPath<T> {
    // Required method
    fn get_path(par: T) -> Result<String, Error>;
}
Expand description

Rest path builder trait for type.

Provides implementation for rest_path function that builds type (and REST endpoint) specific API path from given parameter(s). The built REST path is appended to the base URL given to RestClient. If Err is returned, it is propagated directly to API caller.

Required Methods§

source

fn get_path(par: T) -> Result<String, Error>

Construct type specific REST API path from given parameters (e.g. “api/devices/1234”).

Implementors§