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
So I'd like to know, how does this crate handle the problem, or if it doesn't, have you explored the problem space before coming to the conclusion that this is the best solution for you? Alternatively, is supporting str something you'd like to see in the future?
The text was updated successfully, but these errors were encountered:
This crate just uses an Element generic and deals in [Element]. I consider this crate essentially deprecated in favor of slice-dst, which defines a trait SliceDst which is implemented both for for<T> [T] and should be for str (but apparently I forgot to add that impl oops).
Your three options for being generic over slice types are:
Use [impl Sized] and exclude str (and other custom slice tails).
Use impl ?Sized and include all unsized types, but lack the ability to [into|from]_raw_parts the pointers.
Use a custom trait (e.g. SliceDst). On nightly: feature(ptr_metadata) and Pointee<Metadata = usize>.
I've been meaning to revisit and repolish the various pointer-utils crates, including slice-dst. I've not been eager to do so until feature(ptr_metadata) lands, as that has a large impact on what API I can provide, but maybe I'll decide to do the big cleanup. (The big notable improvement available is using addr_of!, and I want to provide a derive(SliceDst).)
Hi, I'm currently toying around with writing some wrappers around slice types, and quickly ran into the issue of how to be generic over all slices including str-like types: https://users.rust-lang.org/t/generic-bound-over-all-slice-types/98743
So I'd like to know, how does this crate handle the problem, or if it doesn't, have you explored the problem space before coming to the conclusion that this is the best solution for you? Alternatively, is supporting str something you'd like to see in the future?
The text was updated successfully, but these errors were encountered: