{"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.5.0","deps":[],"features":{},"cksum":"sha256:369e4f13efc3269507d2fda6b38060475ee48ac28c35f3b642b1b6ca67dd2d8d","sig":"ed25519:a89966c3f23a79bced80be91023cd7f59af9919889a3773dedc6daf77aa70add7b3ab728582474d2610b84211188ccdf1ec18678a5bd29034484616ee085260f","key_fp":"SHA256:EGxvQ8Gktjf0VMLt5eW4gxeKAR30l3wnVMa2c/DuSHQ","yanked":false,"edition":"2026","hew":">=0.8.0, <0.9.0","registry_sig":"ed25519:b3b3505373d82b84fd7273c544939ac3950c5d1e58bea5eae0ae376aad69acaa6241aff351a3fb24ef1566706e50156196edbe56ccbc6f9ef0be401514d2240f","registry_key_fp":"SHA256:NR2yrof9/ZWkCWyhDODRU8Yvm9Lob/0yYVTdCKzMHb8","published_at":"2026-10-24T00:00:10.936Z","dl":"https://cdn.hewpkg.com/tarballs/hew/storage/s3/0.5.0.tar.zst"}}