| Crate Features |
Description |
Enabled by default? |
export-azure |
Exports all the used Azure crates as a module called core |
Yes. |
unstable |
Tap into unstable features from remi_azure and the remi crate. |
No. |
tracing |
Enables the use of tracing::instrument and emit events for actions by the crate. |
No. |
serde |
Enables the use of serde in StorageConfig |
No. |
log |
Emits log records for actions by the crate |
No. |
Example
use remi_azure::{StorageService, StorageConfig, Credential, CloudLocation};
use remi::{StorageService as _, UploadRequest};
#[tokio::main]
async fn main() {
let storage = StorageService::new(StorageConfig {
credentials: Credential::Anonymous,
container: "my-container".into(),
location: CloudLocation::Public("my-account".into()),
}).unwrap();
storage.init().await.unwrap();
let upload = UploadRequest::default()
.with_content_type(Some("text/plain"))
.with_data("weow fluff");
storage.upload("weow.txt", upload).await.unwrap();
assert!(storage.exists("weow.txt").await.unwrap());
}