How to make this vector of reference wrappers more ergonomic?
The Rust Programming Language Forum
How to make this vector of reference wrappers more ergonomic?
I have an Extension struct that wraps a shared library and some other associated state. For convenience, I've created an ExtensionRef struct that wraps an extension along with its name (for ease of logging). It looks like this: pub struct ExtensionRef { name: String, extension: RefCell<Extension>, } impl ExtensionRef { // Among other functions: pub fn get_extension(&self) -> Result<Ref<'_, Extension>, BorrowError> { return self.extension.try_borrow(); } pub fn get_extension_mut(&sel...
I have an Extension struct that wraps a shared library and some other associated state. For convenience, I've created an ExtensionRef struct that wraps an extension along with…
0 comments
No comments yet.