ptwm_core::chain::wire_compact
ptwm_core::chain::wire_compact
CW2, the compact chain wire.
ptwm_core::chain::wire_compact
crates/ptwm-core/src/chain/wire_compact.rs:1mod wire_compactCW2, the compact chain wire.
ptwm_core::chain::wire_compact::bind_deferred_source
crates/ptwm-core/src/chain/wire_compact.rs:398pub fn bind_deferred_source(chain: &mut Chain, params: &[u8])Replace the params of every bound Source of `chain` with `params`.
ptwm_core::chain::wire_compact::has_deferred_source
crates/ptwm-core/src/chain/wire_compact.rs:390pub fn has_deferred_source(chain: &Chain) -> boolWhether `chain` has a bound Source that a tensor record must supply (a Source node with empty params; see [`write_chain_compact_deferred`]).
ptwm_core::chain::wire_compact::op_from_wire_ref
crates/ptwm-core/src/chain/wire_compact.rs:94pub fn op_from_wire_ref(op_ref: u64) -> Result<OpId, PtwmCoreError>Inverse of [`op_wire_ref`]; unknown ids are rejected.
ptwm_core::chain::wire_compact::op_wire_ref
crates/ptwm-core/src/chain/wire_compact.rs:89pub fn op_wire_ref(op: OpId) -> Result<u64, PtwmCoreError>`op_ref` resolver for the `\x89PTWS` frame: the `OpId` wire id.
ptwm_core::chain::wire_compact::read_chain_compact
crates/ptwm-core/src/chain/wire_compact.rs:247pub fn read_chain_compact(r: &mut Cursor<'_>, bound_source: Option<&[u8]>, resolve: impl ?) -> Result<Chain, PtwmCoreError>Decode one CW2 chain at the cursor. The cursor advances past the chain; bytes after it are left for the caller.
ptwm_core::chain::wire_compact::read_chain_compact_deferred_exact
crates/ptwm-core/src/chain/wire_compact.rs:378pub fn read_chain_compact_deferred_exact(buf: &[u8], resolve: impl ?) -> Result<Chain, PtwmCoreError>Decode a shared (registry) CW2 chain that must fill `buf` exactly. A bound Source comes back with empty params; see [`write_chain_compact_deferred`].
ptwm_core::chain::wire_compact::read_chain_compact_exact
crates/ptwm-core/src/chain/wire_compact.rs:407pub fn read_chain_compact_exact(buf: &[u8], bound_source: Option<&[u8]>, resolve: impl ?) -> Result<Chain, PtwmCoreError>Decode a CW2 chain that must fill `buf` exactly.
ptwm_core::chain::wire_compact::read_chain_with
crates/ptwm-core/src/chain/wire_compact.rs:257pub fn read_chain_with(r: &mut Cursor<'_>, binding: SourceBinding<'_>, resolve: impl ?) -> Result<Chain, PtwmCoreError>Decode one CW2 chain with an explicit [`SourceBinding`]. With [`SourceBinding::Deferred`] a bound Source is returned with empty params.
ptwm_core::chain::wire_compact::read_role_compact
crates/ptwm-core/src/chain/wire_compact.rs:485pub fn read_role_compact(r: &mut Cursor<'_>) -> Result<Role, PtwmCoreError>Read one compact role at the cursor.
ptwm_core::chain::wire_compact::SourceBinding
crates/ptwm-core/src/chain/wire_compact.rs:134pub enum SourceBindingHow a chain's Source params relate to the tensor it encodes.
ptwm_core::chain::wire_compact::write_chain_compact
crates/ptwm-core/src/chain/wire_compact.rs:108pub fn write_chain_compact(chain: &Chain, bound_source: Option<&[u8]>, op_ref: impl ?, out: &mut Vec<u8>) -> Result<(), PtwmCoreError>Encode `chain` as CW2 into `out`.
ptwm_core::chain::wire_compact::write_chain_compact_deferred
crates/ptwm-core/src/chain/wire_compact.rs:124pub fn write_chain_compact_deferred(chain: &Chain, op_ref: impl ?, out: &mut Vec<u8>) -> Result<(), PtwmCoreError>Encode a shared chain (a container registry entry) as CW2 into `out`.
ptwm_core::chain::wire_compact::write_role_compact
crates/ptwm-core/src/chain/wire_compact.rs:465pub fn write_role_compact(role: &Role, out: &mut Vec<u8>) -> Result<(), PtwmCoreError>Append the compact encoding of `role`.