Skip to main content

APICall

Trait APICall 

Source
pub trait APICall {
    type Request: Serialize + DeserializeOwned;
    type Response: Serialize + DeserializeOwned;
    type Error: Serialize + DeserializeOwned + IntoResponse + From<InternalServerError>;

    const ENDPOINT: &str;
}
Expand description

Trait that describes a possible API call over NATS

Required Associated Constants§

Source

const ENDPOINT: &str

The root subject to use

Required Associated Types§

Source

type Request: Serialize + DeserializeOwned

The request type

Source

type Response: Serialize + DeserializeOwned

The response type

Source

type Error: Serialize + DeserializeOwned + IntoResponse + From<InternalServerError>

The error type

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl APICall for AddFederatedEvent

Source§

impl APICall for AddNewEvent

Source§

const ENDPOINT: &str = "add_event"

Source§

type Request = NewEvent

Source§

type Response = OwnedEventId

Source§

type Error = AddNewEventError

Source§

impl APICall for AddRoomMemberEvent

Source§

impl APICall for ContextualizeEvent

Source§

impl APICall for CreateRoom

Source§

impl APICall for ForgetRoom

Source§

const ENDPOINT: &str = "forget_room"

Source§

type Request = OwnedUserId

Source§

type Response = ()

Source§

type Error = ForgetRoomError

Source§

impl APICall for GetRoomEvent

Source§

const ENDPOINT: &str = "get_room_event"

Source§

type Request = (OwnedUserId, OwnedDeviceId, OwnedEventId)

Source§

type Response = Raw<AnyTimelineEvent>

Source§

type Error = GetRoomEventError

Source§

impl APICall for GetRoomMembers

Source§

impl APICall for GetStateEvents

Source§

impl APICall for GetStateEventsDiffs

Source§

impl APICall for GetStateEventsForKey

Source§

impl APICall for ReadReceipt

Source§

impl APICall for RedactEvent

Source§

impl APICall for SetFullyReadMarker