Skip to content

Commit

Permalink
feat(caching): Adds is_readonly method
Browse files Browse the repository at this point in the history
This is needed so something that uses a client can check if it is in
readonly mode or not

Signed-off-by: Taylor Thomas <taylor@cosmonic.com>
  • Loading branch information
thomastaylor312 committed Aug 8, 2024
1 parent 1d31139 commit c48006a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/wasm-pkg-client/src/caching/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ impl<T: Cache> CachingClient<T> {
Self { client, cache }
}

/// Returns whether or not the client is in read-only mode.
pub fn is_readonly(&self) -> bool {
self.client.is_none()
}

/// Returns a list of all package [`VersionInfo`]s available for the given package. This will
/// always fail if no client was provided.
pub async fn list_all_versions(&self, package: &PackageRef) -> Result<Vec<VersionInfo>, Error> {
Expand Down

0 comments on commit c48006a

Please sign in to comment.