Crates.io | remi-azure |
lib.rs | remi-azure |
version | |
source | src |
created_at | 2024-01-15 04:34:45.055013 |
updated_at | 2024-12-04 02:27:11.47911 |
description | ๐ปโโ๏ธ๐งถ Support of Microsoft's Azure Blob Storage with remi-rs primitives |
homepage | |
repository | https://github.com/Noelware/remi-rs |
max_upload_size | |
id | 1100047 |
Cargo.toml error: | TOML parse error at line 22, column 1 | 22 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
remi-rs
crate for support of Microsoft's Azure Blob StorageCrate 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. |
// Cargo.toml:
//
// [dependencies]
// remi = "^0"
// remi-azure = "^0"
// tokio = { version = "^1", features = ["full"] }
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();
// Initialize the container. This will:
//
// * create `my-container` if it doesn't exist
storage.init().await.unwrap();
// Now we can upload files to Azure.
// We define a `UploadRequest`, which will set the content type to `text/plain` and set the
// contents of `weow.txt` to `weow fluff`.
let upload = UploadRequest::default()
.with_content_type(Some("text/plain"))
.with_data("weow fluff");
// Let's upload it!
storage.upload("weow.txt", upload).await.unwrap();
// Let's check if it exists! This `assert!` will panic if it failed
// to upload.
assert!(storage.exists("weow.txt").await.unwrap());
}