MCPcopy Index your code
hub / github.com/GraphiteEditor/Graphite / add_resource

Method add_resource

document/document-format/src/resource.rs:26–34  ·  view source on GitHub ↗

Register a resource under `id` and store its bytes. Commits an `AddResource` delta (a single `DataSource::Embedded` source resolved to the content hash) through the session so the registry records the resource and the entry replicates, then writes the bytes into the working copy's content-addressed store. The caller owns `id` allocation.

(&mut self, id: graph_storage::ResourceId, bytes: &[u8])

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 3

resource_survives_reopenFunction · 0.80
export_carries_resourcesFunction · 0.80

Calls 4

resource_pathMethod · 0.80
append_and_retireMethod · 0.80
write_non_blockingMethod · 0.45

Tested by 3

resource_survives_reopenFunction · 0.64
export_carries_resourcesFunction · 0.64