/// Fetch all events for a given aggregate.
Fetch all events for a given aggregate.
Fetch all events for a given aggregate .
pub async fn query_events_from_client(
    client: &mut EventStoreClient<Channel>,
    aggregate_identifier: &str,
) -> Result<Vec<Event>> {
    let request = GetAggregateEventsRequest {
        aggregate_id: aggregate_identifier.to_string(),
        allow_snapshots: false,
        initial_sequence: 0,
        max_sequence: std::i64::MAX,
        min_token: 0,
    };
    let mut result = Vec::new();
    let mut stream = client.list_aggregate_events(request).await?.into_inner();
    while let Some(event) = stream.message().await? {
        result.push(event.clone());
    }
    Ok(result)
}
pub async fn query_events_from_client ( client : & mut EventStoreClient < Channel > , aggregate_identifier : & str , ) -> Result < Vec < Event > > { let request = GetAggregateEventsRequest { aggregate_id : aggregate_identifier . to_string ( ) , allow_snapshots : false , initial_sequence : 0 , max_sequence : std :: i64 :: MAX , min_token : 0 , } ; let mut result = Vec :: new ( ) ; let mut stream = client . list_aggregate_events ( request ) . await ? . into_inner ( ) ; while let Some ( event ) = stream . message ( ) . await ? { result . push ( event . clone ( ) ) ; } Ok ( result ) }
Fetch all events for a given aggregate.
Fetch all events for a given aggregate .
client
&mut EventStoreClient<Channel>
aggregate_identifier
&str