Fix store delegation for public_url

pull/28/head
asonix 8 months ago
parent 786f583d98
commit 4d78ce7689
  1. 1
      .gitignore
  2. 12
      src/store.rs
  3. 4
      src/store/file_store.rs

1
.gitignore vendored

@ -4,6 +4,7 @@
/client-examples/javascript/node_modules
/docker/object-storage/storage
/docker/object-storage/pict-rs-garage.toml
/docker/object-storage/*.log
/result
/.ash_history
/.direnv

@ -94,9 +94,7 @@ pub(crate) trait Store: Clone + Debug {
content_type: mime::Mime,
) -> Result<Self::Identifier, StoreError>;
fn public_url(&self, _: &Self::Identifier) -> Option<url::Url> {
None
}
fn public_url(&self, _: &Self::Identifier) -> Option<url::Url>;
async fn to_stream(
&self,
@ -160,6 +158,10 @@ where
T::save_bytes(self, bytes, content_type).await
}
fn public_url(&self, identifier: &Self::Identifier) -> Option<url::Url> {
T::public_url(self, identifier)
}
async fn to_stream(
&self,
identifier: &Self::Identifier,
@ -231,6 +233,10 @@ where
T::save_bytes(self, bytes, content_type).await
}
fn public_url(&self, identifier: &Self::Identifier) -> Option<url::Url> {
T::public_url(self, identifier)
}
async fn to_stream(
&self,
identifier: &Self::Identifier,

@ -109,6 +109,10 @@ impl Store for FileStore {
Ok(self.file_id_from_path(path)?)
}
fn public_url(&self, _identifier: &Self::Identifier) -> Option<url::Url> {
None
}
#[tracing::instrument]
async fn to_stream(
&self,

Loading…
Cancel
Save