Update documentation and examples

This commit is contained in:
bitfl0wer 2023-12-10 18:40:03 +01:00
parent 9ca29c6560
commit 40d7da96cd
3 changed files with 3 additions and 3 deletions

View File

@ -62,7 +62,7 @@ async fn main() {
"wss://example.com/".to_string(), "wss://example.com/".to_string(),
"https://example.com/cdn".to_string(), "https://example.com/cdn".to_string(),
); );
let instance = Instance::new(bundle, true) let instance = Instance::new(bundle)
.await .await
.expect("Failed to connect to the Spacebar server"); .expect("Failed to connect to the Spacebar server");
// You can create as many instances of `Instance` as you want, but each `Instance` should likely be unique. // You can create as many instances of `Instance` as you want, but each `Instance` should likely be unique.

View File

@ -72,7 +72,7 @@ impl PartialEq for LimitsInformation {
} }
impl Instance { impl Instance {
/// Creates a new [`Instance`] from the [relevant instance urls](UrlBundle), where `limited` is whether Chorus will track and enforce rate limits for this instance. /// Creates a new [`Instance`] from the [relevant instance urls](UrlBundle). To create an Instance from one singular url, use [`Instance::from_root_url()`].
pub async fn new(urls: UrlBundle) -> ChorusResult<Instance> { pub async fn new(urls: UrlBundle) -> ChorusResult<Instance> {
let is_limited: Option<LimitsConfiguration> = Instance::is_limited(&urls.api).await?; let is_limited: Option<LimitsConfiguration> = Instance::is_limited(&urls.api).await?;
let limit_information; let limit_information;

View File

@ -19,7 +19,7 @@ async fn main() {
"wss://example.com/".to_string(), "wss://example.com/".to_string(),
"https://example.com/cdn".to_string(), "https://example.com/cdn".to_string(),
); );
let instance = Instance::new(bundle, true) let instance = Instance::new(bundle)
.await .await
.expect("Failed to connect to the Spacebar server"); .expect("Failed to connect to the Spacebar server");
// You can create as many instances of `Instance` as you want, but each `Instance` should likely be unique. // You can create as many instances of `Instance` as you want, but each `Instance` should likely be unique.