You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
traitSuccessor{// which is actually equivalent to `trait SubspaceId` at this point.fnsuccessor(&self) -> Option<Self>;}impl<T:Successor>Range<T>{fnnew_exact(value:T) -> Self;}
Helpers for creating Paths from arrays of bytes/strings:
Helpers for printing Paths. Perhaps just a nice Path: Debug instance that interprets the path segments as utf8, if possible, or otherwise escapes to hex or similar. Alternatively something like Path::to_string(&self) -> Option<String> that tries to format using / and utf8, but fails if the path would have to be escaped.
Easily converting an Area into a Range3d: Area::to_range3d(&self) -> Range3d. Alternatively: a From/Into instance.
Easily converting an Area into an AreaOfInterest: AreaOfInterest::new_area(area: Area) -> Self or similar
The text was updated successfully, but these errors were encountered:
Thank you for these suggestions, I'm agreed on all counts. I like the Successor trait, I think the only drawback would be needing a newtype to implement it on u64 for timestamps.
FWIW, I personally find it just easy enough to do a Range::new_closed, if it's a Range<u64>, so I'd be fine without a newtype. (although you're risking a panic in case of an overflow)
I'll try keeping track of some useful helper functions to include in
willow-rs
.Some form of
Range::new_exact
:An alternative for this would be:
Helpers for creating
Path
s from arrays of bytes/strings:Helpers for printing
Path
s. Perhaps just a nicePath: Debug
instance that interprets the path segments as utf8, if possible, or otherwise escapes to hex or similar. Alternatively something likePath::to_string(&self) -> Option<String>
that tries to format using/
and utf8, but fails if the path would have to be escaped.Easily converting an
Area
into aRange3d
:Area::to_range3d(&self) -> Range3d
. Alternatively: aFrom
/Into
instance.Easily converting an
Area
into anAreaOfInterest
:AreaOfInterest::new_area(area: Area) -> Self
or similarThe text was updated successfully, but these errors were encountered: