pub struct PSServer {
pub url: String,
pub credentials: PSCredentials,
pub token: Mutex<Option<PSToken>>,
/* private fields */
}Expand description
A struct for making asynchronous calls to a PageSeeder server.
Fields§
§url: String§credentials: PSCredentials§token: Mutex<Option<PSToken>>Implementations§
Source§impl PSServer
impl PSServer
Sourcepub async fn get_uri(&self, member: &str, uri: &str) -> PSResult<Uri>
pub async fn get_uri(&self, member: &str, uri: &str) -> PSResult<Uri>
Gets info about a single URI.
Sourcepub async fn get_uri_history(
&self,
group: &str,
uri: &str,
) -> PSResult<UriHistory>
pub async fn get_uri_history( &self, group: &str, uri: &str, ) -> PSResult<UriHistory>
Gets the history of a single URI.
Sourcepub async fn get_uris_history(
&self,
group: &str,
events: Vec<EventType>,
params: HashMap<&str, &str>,
) -> PSResult<UriHistory>
pub async fn get_uris_history( &self, group: &str, events: Vec<EventType>, params: HashMap<&str, &str>, ) -> PSResult<UriHistory>
Gets the history of all URIs in a group. TODO add auto pagination
pub async fn get_uri_fragment( &self, member: &str, group: &str, uri: &str, fragment: &str, params: HashMap<&str, &str>, ) -> PSResult<DocumentFragment>
Sourcepub async fn uri_export(
&self,
member: &str,
uri: &str,
params: Vec<(&str, &str)>,
) -> PSResult<Thread>
pub async fn uri_export( &self, member: &str, uri: &str, params: Vec<(&str, &str)>, ) -> PSResult<Thread>
Returns the pageseeder thread that is exporting the URI(s).
Sourcepub async fn group_search(
&self,
group: &str,
params: HashMap<&str, &str>,
) -> PSResult<Vec<SearchResultPage>>
pub async fn group_search( &self, group: &str, params: HashMap<&str, &str>, ) -> PSResult<Vec<SearchResultPage>>
Searches a group. Fetches all pages for a search if no page number is specified in params. This may result in multiple requests.
Sourcepub async fn thread_progress(&self, thread_id: &str) -> PSResult<Thread>
pub async fn thread_progress(&self, thread_id: &str) -> PSResult<Thread>
Gets the progress of a pageseeder thread.
pub async fn put_uri_fragment( &self, member: &str, group: &str, uri: &str, fragment: &str, content: String, params: Option<Vec<(&str, &str)>>, ) -> PSResult<FragmentCreation>
pub async fn add_uri_fragment( &self, member: &str, group: &str, uri: &str, content: &str, params: HashMap<&str, &str>, ) -> PSResult<FragmentCreation>
pub async fn upload( &self, group: &str, filename: &str, file: Vec<u8>, params: HashMap<&str, &str>, ) -> PSResult<Upload>
pub async fn clear_loading_zone( &self, member: &str, group: &str, ) -> PSResult<LoadClear>
pub async fn unzip_loading_zone( &self, member: &str, group: &str, path: &str, params: HashMap<&str, &str>, ) -> PSResult<LoadUnzip>
pub async fn start_loading( &self, member: &str, group: &str, params: HashMap<&str, &str>, ) -> PSResult<LoadStart>
Source§impl PSServer
impl PSServer
Sourcepub fn new(url: String, credentials: PSCredentials) -> Self
pub fn new(url: String, credentials: PSCredentials) -> Self
Instantiates a new PSServer. Defaults to HTTPS and port 443.
pub fn preauth(url: String, credentials: PSCredentials, token: PSToken) -> Self
Sourcepub async fn update_token(&self) -> PSResult<HeaderValue>
pub async fn update_token(&self) -> PSResult<HeaderValue>
Gets a new access token and stores it only if the current one is invalid.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for PSServer
impl !RefUnwindSafe for PSServer
impl Send for PSServer
impl Sync for PSServer
impl Unpin for PSServer
impl !UnwindSafe for PSServer
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