Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider a must_use attribute on SagaResult #15

Open
smklein opened this issue Sep 17, 2021 · 0 comments
Open

Consider a must_use attribute on SagaResult #15

smklein opened this issue Sep 17, 2021 · 0 comments

Comments

@smklein
Copy link
Contributor

smklein commented Sep 17, 2021

SagaResult describes the result of executing a saga, akin to Rust's native Result type:

steno/src/saga_exec.rs

Lines 1407 to 1415 in 8da3eda

/**
* Summarizes the final state of a saga execution
*/
#[derive(Clone, Debug)]
pub struct SagaResult {
pub saga_id: SagaId,
pub saga_log: SagaLog,
pub kind: Result<SagaResultOk, SagaResultErr>,
}

This type is propagated back to the SecClient, where it may be acquired when awaiting the future returned from saga_create.

As this is the only mechanism for actually checking the success or failure of a saga, we should consider annotating it with the must_use attribute.

Note that this would align with the stdlib Result type attribute, which uses must_use to encourage callers to handle errors explicitly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant