pub trait TrySplit<To: Presence>: Presence {
// Required method
fn try_split<T>(
value: Self::Output<T>,
) -> Result<SplitResult<To, Self, T>, Self::Output<T>>
where Self: Sized;
}Expand description
Trait for runtime checked splitting that may fail.
Returns Ok with (selected, remainder) on success, or Err with original value on failure.
Automatically succeeds when Split is implemented (blanket impl); only fails when Optional → Present with None.
Required Methods§
Sourcefn try_split<T>(
value: Self::Output<T>,
) -> Result<SplitResult<To, Self, T>, Self::Output<T>>where
Self: Sized,
fn try_split<T>(
value: Self::Output<T>,
) -> Result<SplitResult<To, Self, T>, Self::Output<T>>where
Self: Sized,
Try to split a value into selected and remainder parts.
§Errors
Returns Err with the original value if the split cannot be performed
(e.g., when trying to convert Optional to Present but the value is None).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.