{"metadata":{"name":"hew/storage/s3","vers":"0.7.1","description":"Actor-owned S3-compatible object storage with typed errors and byte-exact values","license":"MIT OR Apache-2.0","authors":["Hew Contributors"],"deps":[],"features":{},"keywords":["s3","storage","object-storage","aws","minio"],"repository":"https://github.com/hew-lang/ecosystem","edition":"2026","hew":">=0.10.0, <0.12.0","readme":"# hew.storage.s3\n\nAn actor-owned S3-compatible object storage client with typed errors, exact\nbyte payloads, explicit missing-object outcomes, paginated listings, and\nautomatic native cleanup.\n\n## Example\n\nStart an S3-compatible service and create `hew-example`, then save this as\n`main.hew` in a project depending on `hew.storage.s3 = \"0.7.1\"`:\n\n```hew\nimport hew.storage.s3;\nimport std.encoding.utf8;\n\nfn main() {\n    let store = spawn s3.Bucket { options: s3.Options {\n        endpoint: \"http://127.0.0.1:9000\",\n        region: \"us-east-1\",\n        bucket: \"hew-example\",\n        access_key: \"<ACCESS_KEY>\",\n        secret_key: \"<SECRET_KEY>\",\n    } };\n\n    match store.put(\"hello.txt\", \"hello\".to_bytes(), \"text/plain\") {\n        .Ok(_) => println(\"uploaded\"),\n        .Err(.Failed(error)) => println(s3.error_message(error)),\n        .Err(_) => println(\"S3 actor stopped before replying\"),\n    }\n\n    match store.get(\"hello.txt\") {\n        .Ok(.Found(body)) => println(utf8.decode_lossy(body)),\n        .Ok(.Missing) => println(\"object is missing\"),\n        .Err(.Failed(error)) => println(s3.error_message(error)),\n        .Err(_) => println(\"S3 actor stopped before replying\"),\n    }\n\n    stop(store);\n    stopped(store);\n}\n```\n\nEach call replies `Result<T, ActorError<S3Error>>`: `.Ok(value)` on success,\n`.Err(.Failed(error))` for an S3 failure, and another `.Err` variant when the\nactor could not answer (for example `.Dead` after it stopped).\n\nThe checked example at [`examples/basic.hew`](examples/basic.hew) is the same\nprogram, plus a test that runs it, against the MinIO service in\n`docker-compose.yml`. Run it from the\necosystem checkout:\n\n```sh\ndocker compose up --detach --wait minio\nhew run --pkg-path . storage/s3/examples/basic.hew\n```\n\nIt prints `uploaded example/hello.txt` and then `hello`.\n\n## API surface\n\n`spawn s3.Bucket { options: config }` connects and returns the actor handle.\n`Options` fields: `endpoint`, `region`, `bucket`, `access_key`, `secret_key`\n(all `string`).\n\nEvery operation below is `receive fn`, called as `store.<name>(...)`,\nand declares `fails S3Error`:\n\n- `put(key: string, body: bytes, content_type: string) fails S3Error`\n  — upload exact bytes under `key`.\n- `get(key: string) -> ObjectLookup fails S3Error` — download exact bytes.\n  `ObjectLookup` is `.Missing` or `.Found(bytes)`; a missing object is distinct\n  from a present empty one.\n- `delete(key: string) fails S3Error` — deleting an absent key is\n  successful S3 behaviour, not an error.\n- `list(prefix: string) -> Vec<ObjectInfo> fails S3Error` — every object\n  under `prefix`, following continuation tokens. `ObjectInfo` has `key:\n  string` and `size: i64`.\n- `exists(key: string) -> bool fails S3Error`.\n- `presign(key: string, method: string, expires_seconds: i64) -> string fails\n  S3Error` — a signed URL for `\"GET\"`, `\"PUT\"`, `\"DELETE\"`, or `\"HEAD\"`.\n- `stop(store); stopped(store);` — stop the actor and wait for native client cleanup.\n\n`s3.error_message(error: S3Error) -> string` returns the diagnostic carried by\nany `S3Error` variant (`Connection`, `InvalidInput`, `NotFound`,\n`AccessDenied`, `Throttled`, `ServerError(i64, string)`, `Network`,\n`HttpStatus(i64, string)`, `Decode`, `Closed`, `Internal`).\n"},"version":{"name":"hew/storage/s3","vers":"0.6.0","deps":[],"features":{},"cksum":"sha256:6b37da5e52cffd00b0d96cb55682285cfa296534b628f56b5170f3027e097003","sig":"ed25519:5cbd87ffc25b7856ec5222ce383923dffd367d395d68501cd8c83f54a4c310704a60edec0c7238f848747c3f10bf040ffebbf6b15a906e867ece7bd908f75109","key_fp":"SHA256:CB3Ski8183EXzxoy+uSuMpWTxvd/4AlB8CThZu0ZG74","yanked":false,"edition":"2026","hew":">=0.9.0, <0.10.0","registry_sig":"ed25519:c3cf8049909854d63c280888a5667abf9c4f9f80191eee86074b21a2b5fa7c36ef33abd5685466c9868dc54cf754c5fd2f155004b33f67477373cf1592e5c80a","registry_key_fp":"SHA256:NR2yrof9/ZWkCWyhDODRU8Yvm9Lob/0yYVTdCKzMHb8","published_at":"2026-10-24T11:54:16.937Z","dl":"https://cdn.hewpkg.com/tarballs/hew/storage/s3/0.6.0.tar.zst"}}