EventStore / EventStoreDB-Client-Rust

Rust EventStoreDB gRPC Client
MIT License
50 stars 13 forks source link

Checking if a stream exists #174

Closed trentG92 closed 9 months ago

trentG92 commented 9 months ago

Is there a way to check a stream's existence in this crate? read_stream returns a Result but when I do read_stream(stream_id, &Default::default()).await? this causes an error case to early return with the internal message of the error just being "The resource you asked for doesn't exist".

It looks like I see in the c# client you have

var result = client.ReadStreamAsync(
    Direction.Forwards,
    "some-stream",
    10,
    20
);

if (await result.ReadState == ReadState.StreamNotFound) return;
trentG92 commented 9 months ago

Appologies, reading the source code I mistook Error to be std::error::Error for some reason