{"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.3.0","deps":[],"features":{},"cksum":"sha256:d2f58333b39ce3dbc8a81b4572d0fbd8b8f8021f170dc9ee182dbb03661efd2f","sig":"ed25519:21a7de5038bbb6edbe38237ab7194671cb53a00b93922f24e230bbd730fd15d230c741528d8f037ab15d834a13b0175c9fd0bd6897073e9e052d20fc5fb8340c","key_fp":"SHA256:jLehs0udkm2NCjnfcFdvc8l8rkRR5tJ++54dk9PpbGk","yanked":false,"edition":"2026","hew":">=0.6.1, <0.7.0","registry_sig":"ed25519:1215375d93d81dedd6115003ed826b3bf0e0291426361a4e17c3597d96205da47d9213dbf830939b4b55fa12cd9d03a7d00e3e7a7574b3a34192f86e97cd0204","registry_key_fp":"SHA256:NR2yrof9/ZWkCWyhDODRU8Yvm9Lob/0yYVTdCKzMHb8","published_at":"2026-10-17T05:38:36.237Z","dl":"https://cdn.hewpkg.com/tarballs/hew/storage/s3/0.3.0.tar.zst"}}