pub struct ThunderstoreRegistry { /* private fields */ }Expand description
Implementations§
Source§impl ThunderstoreRegistry
impl ThunderstoreRegistry
Sourcepub fn in_memory(client: Client, index: InMemoryIndex) -> Self
pub fn in_memory(client: Client, index: InMemoryIndex) -> Self
Creates a registry backed by an in-memory index.
§Examples
use loadsmith_thunderstore::{ThunderstoreRegistry, in_memory::InMemoryIndex};
use thunderstore::Client;
let client = Client::new();
let index = InMemoryIndex::new(client.clone());
let registry = ThunderstoreRegistry::in_memory(client, index);Sourcepub fn sqlite(client: Client, index: SqliteIndex) -> Self
pub fn sqlite(client: Client, index: SqliteIndex) -> Self
Creates a registry backed by a SQLite index.
§Examples
use loadsmith_thunderstore::{ThunderstoreRegistry, sqlite::SqliteIndex};
use thunderstore::Client;
let client = Client::new();
let db = rusqlite::Connection::open_in_memory().unwrap();
let index = SqliteIndex::connect(client.clone(), db).unwrap();
let registry = ThunderstoreRegistry::sqlite(client, index);Sourcepub async fn update(&self, community: impl Into<String>) -> Result<(), Error>
pub async fn update(&self, community: impl Into<String>) -> Result<(), Error>
Fetches the package index for a thunderstore community.
The community string corresponds to a thunderstore community slug
(e.g. "rounds", "lethal-company").
§Examples
use loadsmith_thunderstore::ThunderstoreRegistry;
let rt = tokio::runtime::Runtime::new().unwrap();
rt.block_on(async {
let registry = ThunderstoreRegistry::default();
registry.update("rounds").await.unwrap();
});Trait Implementations§
Source§impl Clone for ThunderstoreRegistry
impl Clone for ThunderstoreRegistry
Source§fn clone(&self) -> ThunderstoreRegistry
fn clone(&self) -> ThunderstoreRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ThunderstoreRegistry
impl Debug for ThunderstoreRegistry
Source§impl Default for ThunderstoreRegistry
impl Default for ThunderstoreRegistry
Source§impl Registry for ThunderstoreRegistry
impl Registry for ThunderstoreRegistry
Source§fn version_info<'a>(
&'a self,
id: &'a PackageId,
_metadata: Option<&'a Value>,
) -> Pin<Box<dyn Future<Output = Result<Vec<VersionInfo>>> + 'a>>
fn version_info<'a>( &'a self, id: &'a PackageId, _metadata: Option<&'a Value>, ) -> Pin<Box<dyn Future<Output = Result<Vec<VersionInfo>>> + 'a>>
List all available versions of the package identified by
id. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ThunderstoreRegistry
impl !UnwindSafe for ThunderstoreRegistry
impl Freeze for ThunderstoreRegistry
impl Send for ThunderstoreRegistry
impl Sync for ThunderstoreRegistry
impl Unpin for ThunderstoreRegistry
impl UnsafeUnpin for ThunderstoreRegistry
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