Skip to main content

Endpoint

Trait Endpoint 

Source
pub trait Endpoint {
    type Output;

    // Required methods
    fn method(&self) -> &'static str;
    fn path(&self) -> String;

    // Provided methods
    fn query(&self) -> Vec<(String, String)> { ... }
    fn body(&self) -> Option<Value> { ... }
}
Expand description

Generic description of a RomM API endpoint.

Implementations of this trait define the structure and behavior of a specific API call, including its HTTP method, path, query parameters, and body.

Required Associated Types§

Source

type Output

The expected output type of this endpoint, which must be deserializable from JSON.

Required Methods§

Source

fn method(&self) -> &'static str

Returns the HTTP method (e.g., “GET”, “POST”, “PUT”, “DELETE”).

Source

fn path(&self) -> String

Returns the path relative to the base URL (e.g., “/api/roms”).

Provided Methods§

Source

fn query(&self) -> Vec<(String, String)>

Returns the query parameters as a list of key/value pairs. Defaults to an empty list.

Source

fn body(&self) -> Option<Value>

Returns the optional JSON request body. Defaults to None.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl Endpoint for CompleteSyncSession

Source§

impl Endpoint for ConfirmSaveDownloaded

Source§

impl Endpoint for DeleteDevice

Source§

impl Endpoint for DeleteManualCollection

Source§

impl Endpoint for DeletePlatform

Source§

impl Endpoint for DeleteRomNote

Source§

impl Endpoint for DeleteRoms

Source§

impl Endpoint for DeleteSmartCollection

Source§

impl Endpoint for ExchangeClientToken

Source§

impl Endpoint for GetDevice

Source§

impl Endpoint for GetHeartbeat

Source§

impl Endpoint for GetManualCollection

Source§

impl Endpoint for GetPlatform

Source§

impl Endpoint for GetRom

Source§

impl Endpoint for GetRomByHash

Source§

impl Endpoint for GetRomByMetadataProvider

Source§

impl Endpoint for GetRomFilters

Source§

impl Endpoint for GetRomNotes

Source§

impl Endpoint for GetRoms

Source§

impl Endpoint for GetSave

Source§

impl Endpoint for GetSearchCover

Source§

impl Endpoint for GetSearchRoms

Source§

impl Endpoint for GetSmartCollection

Source§

impl Endpoint for GetStats

Source§

impl Endpoint for GetSyncSession

Source§

impl Endpoint for GetTasksStatus

Source§

impl Endpoint for GetUsersMe

Source§

impl Endpoint for GetVirtualCollection

Source§

impl Endpoint for ListCollections

Source§

impl Endpoint for ListDevices

Source§

impl Endpoint for ListPlatforms

Source§

impl Endpoint for ListSaves

Source§

impl Endpoint for ListSmartCollections

Source§

impl Endpoint for ListSupportedPlatforms

Source§

impl Endpoint for ListSyncSessions

Source§

impl Endpoint for ListTasks

Source§

impl Endpoint for ListVirtualCollections

Source§

impl Endpoint for NegotiateSync

Source§

impl Endpoint for PostRomNote

Source§

impl Endpoint for PutPlatform

Source§

impl Endpoint for PutRomNote

Source§

impl Endpoint for PutRomUserProps

Source§

impl Endpoint for RegisterDevice

Source§

impl Endpoint for RunAllTasks

Source§

impl Endpoint for TrackSave

Source§

impl Endpoint for TriggerPushPull

Source§

impl Endpoint for UntrackSave

Source§

impl Endpoint for UpdateDevice