I have been able to check how many events are on other streams using the following code.
let metadata_request_result = client
.get_stream_metadata(stream_name, &eventstore::ReadStreamOptions::default())
.await;
match metadata_request_result {
Ok(metadata_result) => match metadata_result {
eventstore::StreamMetadataResult::Deleted(error) => println! {"The stream was deleted: {}", error},
eventstore::StreamMetadataResult::NotFound(error) => {
println! {"The stream was not found: {}", error}
}
eventstore::StreamMetadataResult::Success(metadata) => {
println! {"The stream has {} events", metadata.version()}
},
},
Err(error) => {
println! {"{}", error.to_string()};
}
}
This works for normal streams; however, when I set the "stream_name" to "$all", "all", or even "$$all" I receive a eventstore::StreamMetadataResult::NotFound error. Is there no metadata stored for the $all stream, and if so is there another way to tell how many events are on the $all stream with out having to read all the events and count them?
I have been able to check how many events are on other streams using the following code.
This works for normal streams; however, when I set the "stream_name" to "$all", "all", or even "$$all" I receive a eventstore::StreamMetadataResult::NotFound error. Is there no metadata stored for the $all stream, and if so is there another way to tell how many events are on the $all stream with out having to read all the events and count them?