async fn delete_projection(
    client: &ProjectionClient,
    gen_name: &mut names::Generator<'_>,
) -> Result<(), Box<dyn std::error::Error>> {
    let name = gen_name.next().unwrap();
    client
        .create(
            name.as_str(),
            PROJECTION_FILE.to_string(),
            &Default::default(),
        )
        .await?;

    debug!("delete_projection: create_projection succeeded: {}", name);

    let stats = client.get_status(name.as_str(), None).await?;

    assert!(stats.is_some());

    let stats = stats.unwrap();

    client.abort(name.as_str(), None).await?;

    assert_eq!(stats.name, name);
    debug!("delete_projection: reading newly-created projection statistic succeeded");

    client.delete(name.as_str(), &Default::default()).await?;

    debug!("delete_projection: delete projection succeeded");

    Ok(())
}
// TODO - A projection must be stopped to be able to delete it. But Stop projection gRPC call doesn't exist yet.
A projection must be stopped to be able to delete it. But Stop projection gRPC call doesn't exist yet.
A projection must be stopped to be able to delete it . But Stop projection gRPC call doesn ' t exist yet .
async fn delete_projection(
    client: &ProjectionClient,
    gen_name: &mut names::Generator<'_>,
) -> Result<(), Box<dyn std::error::Error>> {
    let name = gen_name.next().unwrap();
    client
        .create(
            name.as_str(),
            PROJECTION_FILE.to_string(),
            &Default::default(),
        )
        .await?;
    debug!("delete_projection: create_projection succeeded: {}", name);
    let stats = client.get_status(name.as_str(), None).await?;
    assert!(stats.is_some());
    let stats = stats.unwrap();
    client.abort(name.as_str(), None).await?;
    assert_eq!(stats.name, name);
    debug!("delete_projection: reading newly-created projection statistic succeeded");
    client.delete(name.as_str(), &Default::default()).await?;
    debug!("delete_projection: delete projection succeeded");
    Ok(())
}
async fn delete_projection ( client : & ProjectionClient , gen_name : & mut names :: Generator < ' _ > , ) -> Result < ( ) , Box < dyn std :: error :: Error > > { let name = gen_name . next ( ) . unwrap ( ) ; client . create ( name . as_str ( ) , PROJECTION_FILE . to_string ( ) , & Default :: default ( ) , ) . await ? ; debug ! ( " " name ) ; let stats = client . get_status ( name . as_str ( ) , None ) . await ? ; assert ! ( stats is_some ( ) ) ; let stats = stats . unwrap ( ) ; client . abort ( name . as_str ( ) , None ) . await ? ; assert_eq ! ( stats name name ) ; debug ! ( " " ) ; client . delete ( name . as_str ( ) , & Default :: default ( ) ) . await ? ; debug ! ( " " ) ; Ok ( ( ) ) }
TODO - A projection must be stopped to be able to delete it.
TODO - A projection must be stopped to be able to delete it .
client
&ProjectionClient
gen_name
&mut names::Generator<'_>
client
&ProjectionClient
gen_name
&mut names::Generator<'_>