pub fn append(
        &mut self,
        subnet_id: SubnetId,
        partial: CertifiedStreamSlice,
    ) -> CertifiedSliceResult<()> {
        let partial: UnpackedStreamSlice = partial.try_into()?;

        let (res, slice) = match self.slices.remove(&subnet_id) {
            // We have a pooled slice, try appending to it.
            Some(mut pooled) => (pooled.append(partial), pooled),

            // No existing slice, retain the partial slice (and ensure it's actually complete).
            None => {
                if !partial.is_complete()? {
                    return Err(CertifiedSliceError::InvalidAppend(IndexMismatch));
                }
                (Ok(()), partial)
            }
        };

        self.put_impl(subnet_id, slice)?;
        res
    }
/// Appends a partial slice to the corresponding pool entry, trimming
/// off any prefix before the matching`self.stream_positions` entry.
/// Appending virtually consists of prepending the pooled messages to the
/// provided partial slice.
///
/// The provided partial slice's messages (if any) must extend gap-free the
/// ones already in the pool and its `signals_end` must not regress. Its
/// witness must cover the stream header and the concatenated messages.
///
/// Returns `Err(DecodeFailed)` if `partial` could not be deserialized.
/// Returns `Err(InvalidPayload)`,  `Err(InvalidWitness)` or
/// `Err(WitnessPruningFailed)` if `self` or `partial` are malformed.
/// Returns `Err(InvalidAppend)` if the two slices do not match.
Appends a partial slice to the corresponding pool entry, trimming
off any prefix before the matching`self.stream_positions` entry.
Appending virtually consists of prepending the pooled messages to the
provided partial slice.

The provided partial slice's messages (if any) must extend gap-free the
ones already in the pool and its `signals_end` must not regress. Its
witness must cover the stream header and the concatenated messages.

Returns `Err(DecodeFailed)` if `partial` could not be deserialized.
Appends a partial slice to the corresponding pool entry trimming off any prefix before the matching ` self . stream_positions ` entry . Appending virtually consists of prepending the pooled messages to the provided partial slice . The provided partial slice ' s messages ( if any ) must extend gap - free the ones already in the pool and its ` signals_end ` must not regress . Its witness must cover the stream header and the concatenated messages . Returns ` Err ( DecodeFailed ) ` if ` partial ` could not be deserialized .
pub fn append(
        &mut self,
        subnet_id: SubnetId,
        partial: CertifiedStreamSlice,
    ) -> CertifiedSliceResult<()> {
        let partial: UnpackedStreamSlice = partial.try_into()?;
        let (res, slice) = match self.slices.remove(&subnet_id) {
            // We have a pooled slice, try appending to it.
            Some(mut pooled) => (pooled.append(partial), pooled),
            // No existing slice, retain the partial slice (and ensure it's actually complete).
            None => {
                if !partial.is_complete()? {
                    return Err(CertifiedSliceError::InvalidAppend(IndexMismatch));
                }
                (Ok(()), partial)
            }
        };
        self.put_impl(subnet_id, slice)?;
        res
    }
pub fn append ( & mut self , subnet_id : SubnetId , partial : CertifiedStreamSlice , ) -> CertifiedSliceResult < ( ) > { let partial : UnpackedStreamSlice = partial . try_into ( ) ? ; let ( res , slice ) = match self . slices . remove ( & subnet_id ) { // We have a pooled slice, try appending to it. Some ( mut pooled ) => ( pooled . append ( partial ) , pooled ) , // No existing slice, retain the partial slice (and ensure it's actually complete). None => { if ! partial . is_complete ( ) ? { return Err ( CertifiedSliceError :: InvalidAppend ( IndexMismatch ) ) ; } ( Ok ( ( ) ) , partial ) } } ; self . put_impl ( subnet_id , slice ) ? ; res }
Appends a partial slice to the corresponding pool entry, trimming
off any prefix before the matching`self.stream_positions` entry.
Appends a partial slice to the corresponding pool entry trimming off any prefix before the matching ` self . stream_positions ` entry .
&mut self
subnet_id
SubnetId
partial
CertifiedStreamSlice
&mut self
subnet_id
SubnetId
partial
CertifiedStreamSlice