Skip to main content

PartSink

Trait PartSink 

Source
pub trait PartSink {
    // Required method
    fn store_part(
        &mut self,
        part_name: &str,
        document_json: &str,
    ) -> Option<String>;
}
Expand description

Where an imported assembly’s unique parts are written, so each becomes a document in its own right rather than a payload embedded in one assembly.

A trait, and not a &dyn ModelStore, because the store lives in BREP_app and this crate is BELOW it — BREP_app depends on BREP_render, so naming the store here would be a dependency cycle. The import therefore asks for a key and the app answers with one, which is also what keeps the destination (and any prompt for it) entirely the app’s business.

Required Methods§

Source

fn store_part(&mut self, part_name: &str, document_json: &str) -> Option<String>

Store document_json under a name derived from part_name and return the stable key it can be read back by. None declines — no store, or a write that failed — and the entry stays embedded-only.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§