pub struct EtherpadClient { /* private fields */ }
Expand description
The client for the etherpad API
Implementations§
Source§impl EtherpadClient
impl EtherpadClient
Create a new etherpad author mapped to an internal id
When the mapped id already exists in the etherpad db, the author name gets updated.
Sourcepub async fn create_group_for(
&self,
mapped_id: String,
) -> Result<String, EtherpadError>
pub async fn create_group_for( &self, mapped_id: String, ) -> Result<String, EtherpadError>
Create a new etherpad group mapped to an internal id
pub async fn delete_group(&self, group_id: &str) -> Result<(), EtherpadError>
pub async fn create_group_pad( &self, group_id: &str, pad_name: &str, text: Option<String>, ) -> Result<(), EtherpadError>
pub async fn delete_pad(&self, pad_id: &str) -> Result<(), EtherpadError>
pub async fn get_readonly_pad_id( &self, pad_id: &str, ) -> Result<String, EtherpadError>
pub async fn create_session( &self, group_id: &str, author_id: &str, expires: i64, ) -> Result<String, EtherpadError>
pub async fn create_read_session( &self, group_id: &str, author_id: &str, expires: i64, ) -> Result<String, EtherpadError>
pub async fn delete_session( &self, session_id: &str, ) -> Result<(), EtherpadError>
Sourcepub async fn download_pdf(
&self,
session_id: &str,
readonly_pad_id: &str,
) -> Result<impl Stream<Item = Result<Bytes>> + Unpin, EtherpadError>
pub async fn download_pdf( &self, session_id: &str, readonly_pad_id: &str, ) -> Result<impl Stream<Item = Result<Bytes>> + Unpin, EtherpadError>
Download the current content of the pad as PDF document
Because this is not an API endpoint, a session id has to be provided.
Returns the PDF document as bytes
Sourcepub fn auth_session_url(
&self,
session_id: &str,
pad_name: &str,
group_id: Option<&str>,
) -> Result<Url, EtherpadError>
pub fn auth_session_url( &self, session_id: &str, pad_name: &str, group_id: Option<&str>, ) -> Result<Url, EtherpadError>
The auth_session endpoint sets the session cookie on the client browser and forwards to the pad that was supplied in the query string
Note: Requires the ep_auth_session
plugin to be installed on the etherpad instance
Returns the auth_session url to be called by the client
Trait Implementations§
Source§impl Clone for EtherpadClient
impl Clone for EtherpadClient
Source§fn clone(&self) -> EtherpadClient
fn clone(&self) -> EtherpadClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for EtherpadClient
impl !RefUnwindSafe for EtherpadClient
impl Send for EtherpadClient
impl Sync for EtherpadClient
impl Unpin for EtherpadClient
impl !UnwindSafe for EtherpadClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more