Struct Client

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

Implementations§

Source§

impl Client

Source

pub fn new(cfg: Config) -> Self

Source

pub async fn create_user( &self, name: &str, email: &str, password: Option<&str>, group_id: Option<&GroupId>, role: UserRole, ) -> Result<(), Error>

Source

pub async fn list_users(&self) -> Result<Vec<User>, Error>

Source

pub async fn forgot_username(&self, email: &str) -> Result<(), Error>

Send an email containing all usernames associated with the given address to the email address.

Source

pub async fn delete_user(&self, username: &str) -> Result<(), Error>

Source

pub async fn view_user(&self, username: &str) -> Result<User, Error>

Source

pub async fn update_user( &self, username: &str, update: &UpdateUserData, ) -> Result<User, Error>

Source

pub async fn set_password( &self, username: &str, password: &str, ) -> Result<(), Error>

Source

pub async fn ban_user(&self, username: &str) -> Result<BannedAccount, Error>

Source

pub async fn unban_user(&self, username: &str) -> Result<BannedAccount, Error>

Send a magic link to the given email address. Usable for any user associated with the address.

Source

pub async fn create_project( &self, data: &CreateProjectData, ) -> Result<ProjectMetadata, Error>

Source

pub async fn list_projects( &self, owner: &str, ) -> Result<Vec<ProjectMetadata>, Error>

Source

pub async fn list_shared_projects( &self, owner: &str, ) -> Result<Vec<ProjectMetadata>, Error>

Source

pub async fn get_project_metadata( &self, owner: &str, name: &str, ) -> Result<ProjectMetadata, Error>

Source

pub async fn rename_project( &self, id: &ProjectId, name: &str, ) -> Result<(), Error>

Source

pub async fn rename_role( &self, id: &ProjectId, role_id: &RoleId, name: &str, ) -> Result<(), Error>

Source

pub async fn delete_project(&self, id: &ProjectId) -> Result<(), Error>

Source

pub async fn delete_role( &self, id: &ProjectId, role_id: &RoleId, ) -> Result<(), Error>

Source

pub async fn publish_project( &self, id: &ProjectId, ) -> Result<PublishState, Error>

Source

pub async fn unpublish_project(&self, id: &ProjectId) -> Result<(), Error>

Source

pub async fn get_project( &self, id: &ProjectId, latest: &bool, ) -> Result<Project, Error>

Source

pub async fn get_role( &self, id: &ProjectId, role_id: &RoleId, latest: &bool, ) -> Result<RoleData, Error>

Source

pub async fn list_collaborators( &self, project_id: &str, ) -> Result<Vec<String>, Error>

Source

pub async fn remove_collaborator( &self, project_id: &ProjectId, username: &str, ) -> Result<(), Error>

Source

pub async fn list_collaboration_invites( &self, username: &str, ) -> Result<Vec<CollaborationInvite>, Error>

Source

pub async fn invite_collaborator( &self, id: &ProjectId, username: &str, ) -> Result<(), Error>

Source

pub async fn respond_to_collaboration_invite( &self, id: &InvitationId, state: &InvitationState, ) -> Result<(), Error>

Source

pub async fn list_friends(&self, username: &str) -> Result<Vec<String>, Error>

Source

pub async fn list_online_friends( &self, username: &str, ) -> Result<Vec<String>, Error>

Source

pub async fn list_friend_invites( &self, username: &str, ) -> Result<Vec<FriendInvite>, Error>

Source

pub async fn send_friend_invite( &self, username: &str, recipient: &str, ) -> Result<(), Error>

Source

pub async fn respond_to_friend_invite( &self, recipient: &str, sender: &str, state: FriendLinkState, ) -> Result<(), Error>

Source

pub async fn unfriend(&self, username: &str, friend: &str) -> Result<(), Error>

Source

pub async fn block_user( &self, username: &str, other_user: &str, ) -> Result<(), Error>

Source

pub async fn unblock_user( &self, username: &str, other_user: &str, ) -> Result<(), Error>

Source

pub async fn get_libraries( &self, username: &str, ) -> Result<Vec<LibraryMetadata>, Error>

Source

pub async fn get_submitted_libraries( &self, ) -> Result<Vec<LibraryMetadata>, Error>

Source

pub async fn get_public_libraries(&self) -> Result<Vec<LibraryMetadata>, Error>

Source

pub async fn get_library( &self, username: &str, name: &str, ) -> Result<String, Error>

Source

pub async fn save_library( &self, username: &str, name: &str, blocks: &str, notes: &str, ) -> Result<(), Error>

Source

pub async fn delete_library( &self, username: &str, library: &str, ) -> Result<(), Error>

Source

pub async fn publish_library( &self, username: &str, library: &str, ) -> Result<(), Error>

Source

pub async fn unpublish_library( &self, username: &str, library: &str, ) -> Result<(), Error>

Source

pub async fn approve_library( &self, username: &str, library: &str, state: &PublishState, ) -> Result<(), Error>

Source

pub async fn list_groups(&self, username: &str) -> Result<Vec<Group>, Error>

Source

pub async fn create_group(&self, owner: &str, name: &str) -> Result<(), Error>

Source

pub async fn delete_group(&self, id: &GroupId) -> Result<(), Error>

Source

pub async fn list_members(&self, id: &GroupId) -> Result<Vec<User>, Error>

Source

pub async fn rename_group(&self, id: &GroupId, name: &str) -> Result<(), Error>

Source

pub async fn view_group(&self, id: &GroupId) -> Result<Group, Error>

Source

pub async fn list_user_hosts( &self, username: &str, ) -> Result<Vec<ServiceHost>, Error>

Source

pub async fn list_group_hosts( &self, group_id: &GroupId, ) -> Result<Vec<ServiceHost>, Error>

Source

pub async fn list_hosts( &self, username: &str, ) -> Result<Vec<ServiceHost>, Error>

Source

pub async fn set_user_hosts( &self, username: &str, hosts: Vec<ServiceHost>, ) -> Result<(), Error>

Source

pub async fn set_group_hosts( &self, group_id: &GroupId, hosts: Vec<ServiceHost>, ) -> Result<(), Error>

Source

pub async fn authorize_host( &self, url: &str, id: &str, visibility: ServiceHostScope, ) -> Result<String, Error>

Source

pub async fn unauthorize_host(&self, id: &str) -> Result<(), Error>

Source

pub async fn list_authorized_hosts( &self, ) -> Result<Vec<AuthorizedServiceHost>, Error>

Source

pub async fn list_group_settings( &self, group_id: &GroupId, ) -> Result<Vec<String>, Error>

Source

pub async fn list_user_settings( &self, username: &str, ) -> Result<Vec<String>, Error>

Source

pub async fn get_all_settings( &self, username: &str, service_id: &str, ) -> Result<ServiceSettings, Error>

Source

pub async fn get_group_settings( &self, group_id: &GroupId, service_id: &str, ) -> Result<String, Error>

Source

pub async fn get_user_settings( &self, username: &str, service_id: &str, ) -> Result<String, Error>

Source

pub async fn set_user_settings( &self, username: &str, service_id: &str, settings: String, ) -> Result<String, Error>

Source

pub async fn set_group_settings( &self, group_id: &GroupId, service_id: &str, settings: String, ) -> Result<String, Error>

Source

pub async fn delete_user_settings( &self, username: &str, service_id: &str, ) -> Result<String, Error>

Source

pub async fn delete_group_settings( &self, group_id: &GroupId, service_id: &str, ) -> Result<String, Error>

Source

pub async fn list_external_clients(&self) -> Result<Vec<ExternalClient>, Error>

Source

pub async fn list_networks(&self) -> Result<Vec<ProjectId>, Error>

Source

pub async fn get_room_state(&self, id: &ProjectId) -> Result<RoomState, Error>

Source

pub async fn get_client_state( &self, client_id: &ClientId, ) -> Result<ClientInfo, Error>

Source

pub async fn evict_occupant(&self, client_id: &ClientId) -> Result<(), Error>

Source

pub async fn connect(&self, address: &str) -> Result<MessageChannel, Error>

Source

pub async fn add_oauth_client( &self, client: &CreateClientData, ) -> Result<CreatedClientData, Error>

Source

pub async fn remove_oauth_client(&self, id: &ClientId) -> Result<(), Error>

Source

pub async fn list_oauth_clients(&self) -> Result<Vec<Client>, Error>

Trait Implementations§

Source§

impl Clone for Client

Source§

fn clone(&self) -> Client

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 Client

§

impl RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl UnwindSafe for Client

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> 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,