Add a rust user-space Capability struct.
This is a thin wrapper around a capability ptr that releases the capability when it is done and prevents copying/cloning it. To get a copy a caller must explicitly use duplicate.
This commit is contained in:
parent
19a8ab41d4
commit
7e68c1b641
18 changed files with 215 additions and 152 deletions
|
|
@ -11,7 +11,7 @@ static mut YELLOWSTONE_INIT: Option<YellowstoneClient> = None;
|
|||
pub fn from_init_endpoint() -> &'static mut YellowstoneClient {
|
||||
unsafe {
|
||||
if let None = YELLOWSTONE_INIT {
|
||||
YELLOWSTONE_INIT = Some(YellowstoneClient::new(INIT_ENDPOINT));
|
||||
YELLOWSTONE_INIT = Some(YellowstoneClient::new(Capability::take(INIT_ENDPOINT)));
|
||||
}
|
||||
|
||||
YELLOWSTONE_INIT.as_mut().unwrap()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue