pub struct GeneralApi<'a> { /* private fields */ }Expand description
Main interface for TorBox general operations
Provides methods for all general API calls including:
- Up status
- Changelogs in both RSS and JSON
- Test files
Implementations§
Source§impl<'a> GeneralApi<'a>
impl<'a> GeneralApi<'a>
pub fn new(client: &'a TorboxClient) -> GeneralApi<'a>
pub async fn get_up_status(&self) -> Result<ApiResponse<()>, ApiError>
pub async fn get_stats( &self, ) -> Result<ApiResponse<TorboxGeneralStats>, ApiError>
pub async fn get_changelog_rss_feed(&self) -> Result<String, ApiError>
pub async fn get_changelog_json_versions( &self, ) -> Result<ApiResponse<Vec<ChangelogJsonVersion>>, ApiError>
pub async fn get_speedtest_files( &self, test_length: Option<FileLength>, region: Option<String>, ) -> Result<ApiResponse<Vec<SpeedtestFile>>, ApiError>
Trait Implementations§
Source§impl<'a> NamedType for GeneralApi<'a>
impl<'a> NamedType for GeneralApi<'a>
fn sid() -> SpectaID
Source§fn named_data_type(
type_map: &mut TypeCollection,
generics: &[DataType],
) -> NamedDataType
fn named_data_type( type_map: &mut TypeCollection, generics: &[DataType], ) -> NamedDataType
this is equivalent to Type::inline but returns a NamedDataType instead.
Source§fn definition_named_data_type(type_map: &mut TypeCollection) -> NamedDataType
fn definition_named_data_type(type_map: &mut TypeCollection) -> NamedDataType
this is equivalent to [Type::definition] but returns a NamedDataType instead.
Source§impl<'a> Type for GeneralApi<'a>
impl<'a> Type for GeneralApi<'a>
Source§fn inline(type_map: &mut TypeCollection, generics: Generics<'_>) -> DataType
fn inline(type_map: &mut TypeCollection, generics: Generics<'_>) -> DataType
Returns the definition of a type using the provided generics. Read more
Source§fn reference(type_map: &mut TypeCollection, generics: &[DataType]) -> Reference
fn reference(type_map: &mut TypeCollection, generics: &[DataType]) -> Reference
Generates a datatype corresponding to a reference to this type,
as determined by its category. Getting a reference to a type implies that
it should belong in the type map (since it has to be referenced from somewhere),
so the output of
definition will be put into the type map.impl<'a> Flatten for GeneralApi<'a>
Auto Trait Implementations§
impl<'a> Freeze for GeneralApi<'a>
impl<'a> !RefUnwindSafe for GeneralApi<'a>
impl<'a> Send for GeneralApi<'a>
impl<'a> Sync for GeneralApi<'a>
impl<'a> Unpin for GeneralApi<'a>
impl<'a> UnsafeUnpin for GeneralApi<'a>
impl<'a> !UnwindSafe for GeneralApi<'a>
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