pub trait WriteToBytes: Writer {
// Required method
fn write_to_vec(&self) -> Result<Vec<u8>>;
// Provided method
fn write_to<W: Write>(&self, writer: &mut W) -> Result<()> { ... }
}Expand description
Common interface for writers that can emit a complete file payload.
This complements Writer::write for callers that need to send bytes over
the network, store them in an archive, or run roundtrips without temporary
files.
Required Methods§
Sourcefn write_to_vec(&self) -> Result<Vec<u8>>
fn write_to_vec(&self) -> Result<Vec<u8>>
Write all added data into a byte vector.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl WriteToBytes for FbxWriter
Available on crate feature
fbx-writer only.impl WriteToBytes for GltfWriter
Available on crate feature
gltf-writer only.impl WriteToBytes for ObjWriter
Available on crate feature
obj-writer only.impl WriteToBytes for PlyWriter
Available on crate feature
ply-writer only.