-
Notifications
You must be signed in to change notification settings - Fork 31
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
Document interned string location #75
Comments
Hi, this is a good question and indeed we are missing docs for this. From what I remember this use case is exactly what the |
I'm repurposing this question into a task to:
I'll do this shortly in a related PR. |
While responding I realized that besides documentation, this can be communicated with lifetimes as well. #76 would allow constructing I also realized that Currently, none of the backends support this kind of use and #76 is basically the prerequisite. I want something along the lines of |
Documentation doesn't specify whether interned string will be moved.
I'm using
StringInterner
at the moment, but this clarification would be useful for all implementations.I want to produce
Cow<'inerner_owner, str>
from strings and am wondering whether inserting new strings can cause their layout to shift.Example:
["a", ..., "hello", "there", "world"]
, insert "hello world"["a", ..., "hello world", "there"]
I'm assuming this isn't the case, but a backend that's optimized for minimal memory footprint could implement such optimizations, so it would be nice for docs to specify whether string position is persistent.
The text was updated successfully, but these errors were encountered: