MCPcopy Create free account
hub / github.com/GraphiteEditor/Graphite / new

Method new

node-graph/libraries/resources/src/lib.rs:17–20  ·  view source on GitHub ↗
(data: T)

Source from the content-addressed store, hash-verified

15
16impl Resource {
17 pub fn new<T: AsRef<[u8]> + Send + Sync + 'static>(data: T) -> Self {
18 let hash = ResourceHash::from(data.as_ref());
19 Self { inner: Arc::new(data), hash }
20 }
21
22 pub fn new_unchecked<T: AsRef<[u8]> + Send + Sync + 'static>(data: T, hash: ResourceHash) -> Self {
23 Self { inner: Arc::new(data), hash }

Callers

nothing calls this directly

Calls 2

generate_uuidFunction · 0.85
as_refMethod · 0.45

Tested by

no test coverage detected