MCPcopy Create free account
hub / github.com/PerroEngine/Perro / kind

Method kind

perro_source/api_modules/perro_resource_api/src/res_path.rs:92–100  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

90 return Ok(unsafe { Self::new_unchecked(existing) });
91 }
92 let leaked: &'static str = Box::leak(path.to_owned().into_boxed_str());
93 pool.insert(leaked);
94 // SAFETY: validate rejects paths outside ResPath grammar and leaked str is static.
95 Ok(unsafe { Self::new_unchecked(leaked) })
96 }
97
98 /// # Safety
99 ///
100 /// Caller must pass a valid resource path.
101 pub const unsafe fn new_unchecked(path: &'static str) -> &'static Self {
102 // SAFETY: ResPath is repr(transparent) over str; caller upholds path validity.
103 unsafe { &*(path as *const str as *const Self) }

Callers 9

recv_fromMethod · 0.80
read_availableMethod · 0.80
read_into_frame_bufMethod · 0.80
acceptMethod · 0.80
read_messageMethod · 0.80
acceptMethod · 0.80
bodyMethod · 0.80
bind_web_dev_listenerFunction · 0.80
run_static_serverFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected