pub enum Endpoint {
Production,
Custom(Url),
}Expand description
Base API endpoint used by the client.
Variants§
Production
The public Figshare production service.
Custom(Url)
A fully custom Figshare-compatible API base URL.
Implementations§
Source§impl Endpoint
impl Endpoint
Sourcepub fn base_url(&self) -> Result<Url, ParseError>
pub fn base_url(&self) -> Result<Url, ParseError>
Returns the API base URL for this endpoint.
§Errors
Returns an error if the configured URL cannot be parsed into a valid base URL.
§Examples
use figshare_rs::Endpoint;
let endpoint = Endpoint::Custom("http://localhost:1234".parse()?);
assert_eq!(endpoint.base_url()?.as_str(), "http://localhost:1234/v2/");Trait Implementations§
impl Eq for Endpoint
impl StructuralPartialEq for Endpoint
Auto Trait Implementations§
impl Freeze for Endpoint
impl RefUnwindSafe for Endpoint
impl Send for Endpoint
impl Sync for Endpoint
impl Unpin for Endpoint
impl UnsafeUnpin for Endpoint
impl UnwindSafe for Endpoint
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