acadia/rust/sys/victoriafalls/src/lib.rs
Drew Galbraith a8d97ce0b3
Some checks failed
Check / Check Rust (pull_request) Failing after 21s
Add rust lint CI job.
2025-12-14 00:53:28 -08:00

32 lines
840 B
Rust

#![no_std]
use core::include;
include!(concat!(env!("OUT_DIR"), "/yunq.rs"));
pub mod dir;
pub mod file;
pub mod server;
static mut VFS_CLIENT: Option<VFSClient> = None;
fn get_client() -> &'static mut VFSClient {
unsafe {
#[allow(static_mut_refs)]
if VFS_CLIENT.is_none() {
let endpoint_cap = yellowstone_yunq::from_init_endpoint()
.get_endpoint(&yellowstone_yunq::GetEndpointRequest {
endpoint_name: "victoriafalls".to_string(),
})
.expect("Failed to get VFS endpoint");
VFS_CLIENT = Some(VFSClient::new(Capability::take(endpoint_cap.endpoint)));
}
#[allow(static_mut_refs)]
VFS_CLIENT.as_mut().unwrap()
}
}
pub fn set_client(client: VFSClient) {
unsafe { VFS_CLIENT = Some(client) };
}