{"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.7.1","deps":[],"features":{},"cksum":"sha256:bd465f0d1888f958db1e693e637cd2a8cb0050d4bc5b04c114af8784e5578f7a","sig":"ed25519:d3bce0b65eb5936e72da6c915bf499499d3951a876baed9d5d5c482e898414df2c46eab53b903ca62832c6f246d07d8454fcd76479062ed5ebda45b98d36eb09","key_fp":"SHA256:jiRoI3zNjRf/jbs3rkssGHT0JSZIte0YQJ/WV2hf5xE","yanked":false,"edition":"2026","hew":">=0.10.0, <0.12.0","registry_sig":"ed25519:42d28d944b7b780cacfad7dde68e8da7c87bfb4490308a5b536d213bb92bf651eadc94c2a03904a21e05a3c190b9ecd21c38295a6e0b2889eec4adaf62949e00","registry_key_fp":"SHA256:NR2yrof9/ZWkCWyhDODRU8Yvm9Lob/0yYVTdCKzMHb8","published_at":"2026-11-19T02:50:54.998Z","dl":"https://cdn.hewpkg.com/tarballs/hew/storage/s3/0.7.1.tar.zst"}}