Repository navigation
v0.1.0-beta.3
Pre-release
Pre-release
·
61 commits
to main
since this release
The third beta, which makes the API friendlier and breaks code written for 0.1.0-beta.2: specification 0.1.0, tier 1, capabilities sync, async and testing, cases v0.1.0-rc.15. What a journey does is unchanged. The minimum supported Rust version is 1.85.
Added
error::Result<T, E = Error>, the result custom code returns, such asResult<Outcome>from a step'srun. A service provider declared with#[workflow]may returnResult<Provided<T>>.- Readers on how a journey ended:
JourneyStatus::is_succeeded,is_failed,is_aborted,failureandabort, andFailure::reasonanderror. step::Attempt, an attempt's number, counted from 1, withAttempt::FIRSTandis_first().event::EventKind, an event's kind, which displays as its snake_case name and parses from it.workflow::Supplied, what an input adapter returns, withSupplied::valueand the readerdowncast_ref::<T>().journey::Read::present, the value read when it is present and of the type asked for.
Changed
- Step hooks return
policy::OnSuccess(on step success) orpolicy::OnFailure(on step failure,on step retryandon step abnormal termination) instead of anOptionof a lifecycle:KeepDefault,FinishWorkflowforOnSuccessonly, orFailWorkflowwith a reason, made withOnSuccess::fail_workfloworOnFailure::fail_workflow, which take any text. They read themselves back withkeeps_default,fails_workflowand, onOnSuccess,finishes_workflow. The shorthandDescribedPolicy::carry_on()is nowkeep_default(); theReturnedLifecycletrait and theFailWorkflowstruct are gone. - Input adapters return
workflow::Supplied, aValueorFromDataBag, instead of anOptionof a value, and take the data bag as&DataBag, whosereadis now public;DataBagAccessandDataBag::accessare gone. - Steps and hooks take the contributor as
&mut journey::Contributor, with no lifetime. - The macros recognise a handle by its type, so
#[contributor],#[reporter],#[journey_id],#[step_name],#[attempt],#[reason],#[error],#[cause]and#[data_bag]are gone. Marks stay where the type cannot say what is requested:#[input],#[service],#[from_step],#[from_workflow],#[from_rescued_step],#[key]and#[role]. - An attempt's number is a
step::Attemptinstead of aNonZeroU32wherever it is public; scripts still number attempts with plain integers. Event::kindandEventBody::kindreturn anEventKindinstead of a&'static str.Outcome::failure,Outcome::skipped_becauseandRescueOutcome::failuretake anything that converts into aReason, so a text is the reason's code.- In the builder form, each source of data has one request method, which takes an
Inputor anOptionalInput, through the sealedstep::InputToken, and gives the value or anOptionof it:optional_input,optional_from_workflow,optional_from_stepandoptional_from_rescued_stepare gone. ProvidesandInputAdaptermove frompolicytoworkflow, andProvidertoservice.- A release is published only once every CI check passes on its tagged commit, and docs.rs builds each crate with its features other than
unstable.