MCPcopy Create free account
hub / github.com/JaredStewart/coderlm / create_buffer

Function create_buffer

server/src/ops/buffers.rs:20–34  ·  view source on GitHub ↗

CRUD operations for named buffers stored per-project.

(
    buffers: &DashMap<String, Buffer>,
    name: &str,
    content: &str,
    description: Option<&str>,
)

Source from the content-addressed store, hash-verified

18
19/// CRUD operations for named buffers stored per-project.
20pub fn create_buffer(
21 buffers: &DashMap<String, Buffer>,
22 name: &str,
23 content: &str,
24 description: Option<&str>,
25) -> Result<Buffer, String> {
26 let buf = Buffer {
27 name: name.to_string(),
28 content: content.to_string(),
29 description: description.map(|s| s.to_string()),
30 created_at: Utc::now(),
31 };
32 buffers.insert(name.to_string(), buf.clone());
33 Ok(buf)
34}
35
36pub fn from_file(
37 buffers: &DashMap<String, Buffer>,

Callers 2

from_fileFunction · 0.70
from_symbolFunction · 0.70

Calls 1

insertMethod · 0.45

Tested by

no test coverage detected