Skip to content

feat: Allow GpmSample to be reconstructed from the raw handle - #141

Open
TheElectronWill wants to merge 1 commit into
rust-nvml:mainfrom
TheElectronWill:feat/gpm-sample-from-raw
Open

feat: Allow GpmSample to be reconstructed from the raw handle#141
TheElectronWill wants to merge 1 commit into
rust-nvml:mainfrom
TheElectronWill:feat/gpm-sample-from-raw

Conversation

@TheElectronWill

Copy link
Copy Markdown
Contributor

Use case: I have a Nvml with a non-static lifetime, and I want to keep a sample in memory until I get the next one.
Dealing with the non-static lifetimes everywhere is troublesome...

If there was a way to keep the raw sample and convert it when needed, it would work. Unfortunately, there's no way to do this for the moment.

GpmSample -> raw sample: ok
raw sample -> GpmSample: not ok

This PR solves the problem by adding GpmSample::from_handle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant