I have a situation where I would like to call a method that takes self on a tail field, and then get the head fields back. I don't think this is possible currently, but would there be interest in adding such an ability? (Or a reason why it might be unsafe?).
An example situation:
struct A;
struct B<'a> {
a: &'a A
}
impl<'a> B<'a> {
fn new(&'a A) -> B<'a> { B { a } }
fn final(self) { ... }
}
#[self_referencing]
struct Wrapper {
a: A,
#[borrows(mut a)]
b: B<'a>,
}
In this case I would like to be able to, given a Wrapper, call B::final and get back a.
I think a possible function signature for the wrapper type would be:
I have a situation where I would like to call a method that takes
self
on a tail field, and then get the head fields back. I don't think this is possible currently, but would there be interest in adding such an ability? (Or a reason why it might be unsafe?).An example situation:
In this case I would like to be able to, given a
Wrapper
, callB::final
and get backa
.I think a possible function signature for the wrapper type would be:
or something?
Thoughts very much welcome (and thanks for this library!) :slightly_smiling_face: