pub enum UnifiedClient {
V3(ApiV3Client),
V4(ApiV4Client),
}Expand description
Unified Cloudreve client that automatically handles version differences
Variants§
V3(ApiV3Client)
V4(ApiV4Client)
Implementations§
Source§impl UnifiedClient
impl UnifiedClient
Sourcepub async fn new(base_url: &str) -> Result<Self, Error>
pub async fn new(base_url: &str) -> Result<Self, Error>
Create a new client with automatic version detection
Sourcepub async fn with_version(
base_url: &str,
version: Option<ApiVersion>,
) -> Result<Self, Error>
pub async fn with_version( base_url: &str, version: Option<ApiVersion>, ) -> Result<Self, Error>
Create a new client with explicit version or auto-detection
Sourcepub async fn get_version(&self) -> Result<VersionInfo, Error>
pub async fn get_version(&self) -> Result<VersionInfo, Error>
Get version information
Sourcepub fn api_version(&self) -> ApiVersion
pub fn api_version(&self) -> ApiVersion
Get the API version
Sourcepub fn as_v3(&self) -> Option<&ApiV3Client>
pub fn as_v3(&self) -> Option<&ApiV3Client>
Get V3 client reference if applicable
Sourcepub fn as_v4(&self) -> Option<&ApiV4ClientInner>
pub fn as_v4(&self) -> Option<&ApiV4ClientInner>
Get V4 client reference if applicable
Sourcepub fn as_v3_mut(&mut self) -> Option<&mut ApiV3Client>
pub fn as_v3_mut(&mut self) -> Option<&mut ApiV3Client>
Get mutable V3 client reference if applicable
Sourcepub fn as_v4_mut(&mut self) -> Option<&mut ApiV4ClientInner>
pub fn as_v4_mut(&mut self) -> Option<&mut ApiV4ClientInner>
Get mutable V4 client reference if applicable
Trait Implementations§
Source§impl Clone for UnifiedClient
impl Clone for UnifiedClient
Auto Trait Implementations§
impl Freeze for UnifiedClient
impl !RefUnwindSafe for UnifiedClient
impl Send for UnifiedClient
impl Sync for UnifiedClient
impl Unpin for UnifiedClient
impl !UnwindSafe for UnifiedClient
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