Http

Struct Http 

Source
pub struct Http { /* private fields */ }

Implementations§

Source§

impl Http

Source

pub fn new(token: SessionToken) -> Self

Source

pub fn with_base_url(self, base_url: Url) -> Self

Source

pub fn for_puppet(&self, id: UserId) -> Self

Source

pub async fn media_upload( &self, target: &MediaCreated, body: Vec<u8>, ) -> Result<Option<Media>>

Source

pub async fn thread_list( &self, channel_id: ChannelId, query: &PaginationQuery<ChannelId>, ) -> Result<PaginationResponse<Channel>>

Source

pub async fn channel_list( &self, room_id: RoomId, query: &PaginationQuery<ChannelId>, ) -> Result<PaginationResponse<Channel>>

Source

pub async fn message_list( &self, channel_id: ChannelId, query: &PaginationQuery<MessageId>, ) -> Result<PaginationResponse<Message>>

Source§

impl Http

Source

pub async fn media_info_get(&self, media_id: MediaId) -> Result<Media>

Source§

impl Http

Source

pub async fn channel_create_room( &self, room_id: RoomId, body: &ChannelCreate, ) -> Result<Channel>

Source§

impl Http

Source

pub async fn channel_update( &self, channel_id: ChannelId, body: &ChannelPatch, ) -> Result<Channel>

Source§

impl Http

Source

pub async fn channel_get(&self, channel_id: ChannelId) -> Result<Channel>

Source§

impl Http

Source

pub async fn media_create(&self, body: &MediaCreate) -> Result<MediaCreated>

Source§

impl Http

Source

pub async fn message_delete( &self, channel_id: ChannelId, message_id: MessageId, ) -> Result<()>

Source§

impl Http

Source

pub async fn message_edit( &self, channel_id: ChannelId, message_id: MessageId, body: &MessagePatch, ) -> Result<Message>

Source§

impl Http

Source

pub async fn message_get( &self, channel_id: ChannelId, message_id: MessageId, ) -> Result<Message>

Source§

impl Http

Source

pub async fn message_create( &self, channel_id: ChannelId, body: &MessageCreate, ) -> Result<Message>

Source§

impl Http

Source

pub async fn message_react( &self, channel_id: ChannelId, message_id: MessageId, reaction: String, ) -> Result<()>

Source§

impl Http

Source

pub async fn message_unreact( &self, channel_id: ChannelId, message_id: MessageId, reaction: String, ) -> Result<()>

Source§

impl Http

Source

pub async fn channel_typing(&self, channel_id: ChannelId) -> Result<()>

Source§

impl Http

Source

pub async fn user_get(&self, user_id: UserIdReq) -> Result<UserWithRelationship>

Source§

impl Http

Source

pub async fn room_member_add( &self, room_id: RoomId, user_id: UserIdReq, body: &RoomMemberPut, ) -> Result<RoomMember>

Source§

impl Http

Source

pub async fn room_member_patch( &self, room_id: RoomId, user_id: UserIdReq, body: &RoomMemberPatch, ) -> Result<RoomMember>

Source§

impl Http

Source

pub async fn user_update( &self, user_id: UserIdReq, body: &UserPatch, ) -> Result<User>

Source§

impl Http

Source

pub async fn user_set_status( &self, user_id: UserIdReq, body: &StatusPatch, ) -> Result<()>

Source§

impl Http

Source

pub async fn puppet_ensure( &self, app_id: ApplicationId, puppet_id: String, body: &PuppetCreate, ) -> Result<User>

Source§

impl Http

Source

pub async fn channel_create_dm(&self, body: &ChannelCreate) -> Result<Channel>

Source§

impl Http

Source

pub async fn channel_reorder( &self, room_id: RoomId, body: &ChannelReorder, ) -> Result<()>

Source§

impl Http

Source

pub async fn channel_remove(&self, channel_id: ChannelId) -> Result<()>

Source§

impl Http

Source

pub async fn channel_restore(&self, channel_id: ChannelId) -> Result<()>

Source§

impl Http

Source

pub async fn channel_upgrade(&self, channel_id: ChannelId) -> Result<Room>

Source§

impl Http

Source

pub async fn channel_transfer_ownership( &self, channel_id: ChannelId, body: &TransferOwnership, ) -> Result<()>

Source§

impl Http

Source

pub async fn dm_init(&self, target_id: UserId) -> Result<Channel>

Source§

impl Http

Source

pub async fn dm_get(&self, target_id: UserId) -> Result<Channel>

Source§

impl Http

Source

pub async fn message_version_get( &self, channel_id: ChannelId, message_id: MessageId, version_id: MessageVerId, ) -> Result<Message>

Source§

impl Http

Source

pub async fn message_moderate( &self, channel_id: ChannelId, body: &MessageModerate, ) -> Result<()>

Source§

impl Http

Source

pub async fn message_move( &self, channel_id: ChannelId, body: &MessageMigrate, ) -> Result<()>

Source§

impl Http

Source

pub async fn message_pin_create( &self, channel_id: ChannelId, message_id: MessageId, ) -> Result<()>

Source§

impl Http

Source

pub async fn message_pin_delete( &self, channel_id: ChannelId, message_id: MessageId, ) -> Result<()>

Source§

impl Http

Source

pub async fn message_pin_reorder( &self, channel_id: ChannelId, body: &PinsReorder, ) -> Result<()>

Source§

impl Http

Source

pub async fn room_create(&self, body: &RoomCreate) -> Result<Room>

Source§

impl Http

Source

pub async fn room_get(&self, room_id: RoomId) -> Result<Room>

Source§

impl Http

Source

pub async fn room_edit(&self, room_id: RoomId, body: &RoomPatch) -> Result<Room>

Source§

impl Http

Source

pub async fn room_delete(&self, room_id: RoomId) -> Result<()>

Source§

impl Http

Source

pub async fn room_undelete(&self, room_id: RoomId) -> Result<()>

Source§

impl Http

Source

pub async fn room_ack(&self, room_id: RoomId) -> Result<()>

Source§

impl Http

Source

pub async fn room_quarantine(&self, room_id: RoomId) -> Result<Room>

Source§

impl Http

Source

pub async fn room_unquarantine(&self, room_id: RoomId) -> Result<Room>

Source§

impl Http

Source

pub async fn room_transfer_ownership( &self, room_id: RoomId, body: &TransferOwnership, ) -> Result<()>

Source§

impl Http

Source

pub async fn room_member_get( &self, room_id: RoomId, user_id: UserIdReq, ) -> Result<RoomMember>

Source§

impl Http

Source

pub async fn room_member_delete( &self, room_id: RoomId, user_id: UserIdReq, ) -> Result<()>

Source§

impl Http

Source

pub async fn room_ban_create( &self, room_id: RoomId, user_id: UserIdReq, body: &RoomBanCreate, ) -> Result<()>

Source§

impl Http

Source

pub async fn room_ban_create_bulk( &self, room_id: RoomId, body: &RoomBanBulkCreate, ) -> Result<()>

Source§

impl Http

Source

pub async fn room_ban_remove( &self, room_id: RoomId, user_id: UserIdReq, ) -> Result<()>

Source§

impl Http

Source

pub async fn room_ban_get( &self, room_id: RoomId, user_id: UserIdReq, ) -> Result<RoomBan>

Source§

impl Http

Source

pub async fn thread_member_get( &self, thread_id: ChannelId, user_id: UserIdReq, ) -> Result<ThreadMember>

Source§

impl Http

Source

pub async fn thread_member_add( &self, thread_id: ChannelId, user_id: UserIdReq, body: &ThreadMemberPut, ) -> Result<ThreadMember>

Source§

impl Http

Source

pub async fn thread_member_delete( &self, thread_id: ChannelId, user_id: UserIdReq, ) -> Result<()>

Source§

impl Http

Source

pub async fn user_delete(&self, user_id: UserIdReq) -> Result<()>

Source§

impl Http

Source

pub async fn user_undelete(&self, user_id: UserIdReq) -> Result<()>

Source§

impl Http

Source

pub async fn guest_create(&self, body: &UserCreate) -> Result<User>

Source§

impl Http

Source

pub async fn user_suspend( &self, user_id: UserIdReq, body: &SuspendRequest, ) -> Result<User>

Source§

impl Http

Source

pub async fn user_unsuspend(&self, user_id: UserIdReq) -> Result<User>

Trait Implementations§

Source§

impl Clone for Http

Source§

fn clone(&self) -> Http

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl Freeze for Http

§

impl !RefUnwindSafe for Http

§

impl Send for Http

§

impl Sync for Http

§

impl Unpin for Http

§

impl !UnwindSafe for Http

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,