MCPcopy Create free account
hub / github.com/RetypeOS/parcode / from_bytes

Method from_bytes

src/reader.rs:648–652  ·  view source on GitHub ↗

Opens a Parcode file from an in-memory buffer. This is the primary entry point for tests and architectures without direct file access. The `ParcodeFile` takes ownership of the data (wrapped in Arc).

(data: impl Into<Arc<Vec<u8>>>)

Source from the content-addressed store, hash-verified

646 /// This is the primary entry point for tests and architectures without direct file access.
647 /// The `ParcodeFile` takes ownership of the data (wrapped in Arc).
648 pub fn from_bytes(data: impl Into<Arc<Vec<u8>>>) -> Result<Self> {
649 let data_arc = data.into();
650 let size = data_arc.len() as u64;
651 Self::init(DataSource::Memory(data_arc), size)
652 }
653
654 fn init(source: DataSource, file_size: u64) -> Result<Self> {
655 if file_size < GLOBAL_HEADER_SIZE as u64 {

Callers

nothing calls this directly

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected