vyre 0.4.0

GPU compute intermediate representation with a standard operation library
Documentation
//! Sequence encoder for IR node lists.

use super::put_node;
use crate::ir::serial::wire::framing::put_len_u32;
use crate::ir::serial::wire::Node;

/// Append a length-prefixed sequence of IR nodes.
///
/// # Errors
///
/// Returns an actionable error when the node count exceeds the wire-format
/// length field or when any individual node fails to encode.
#[inline]
pub fn put_nodes(out: &mut Vec<u8>, nodes: &[Node]) -> Result<(), String> {
    put_len_u32(out, nodes.len(), "node count")?;
    for node in nodes {
        put_node(out, node)?;
    }
    Ok(())
}