/// Appends a partial slice with a matching witness to `self`.
///
/// A partial slice is a slice with messages covering only a (possibly
/// zero-length) suffix of the range covered by its witness.
///
/// Returns `Err(InvalidPayload)` if `self.payload` is malformed. Returns
/// `Err(InvalidWitness)` if `self.merkle_proof` is malformed. Returns
/// `Err(InvalidAppend)` if `partial`'s witness doesn't precisely cover the
/// concatenation of `self`s and `partial`s messages; if `partial` has a
/// different `subnet_id`; its messages do not extend `self`'s gap-free; or
/// its `signals_end` regresses.
Appends a partial slice with a matching witness to `self`.
A partial slice is a slice with messages covering only a (possibly
zero-length) suffix of the range covered by its witness.


Appends a partial slice with a matching witness to ` self ` . A partial slice is a slice with messages covering only a ( possibly zero - length ) suffix of the range covered by its witness .
pub fn append(&mut self, partial: UnpackedStreamSlice) -> CertifiedSliceResult<()> {
        let messages_begin = self.payload.messages_begin();
        if messages_begin.is_some() {
            if messages_begin != partial.witness_messages_begin()? {
                return Err(CertifiedSliceError::InvalidAppend(IndexMismatch));
            }
        } else if !partial.is_complete()? {
            return Err(CertifiedSliceError::InvalidAppend(IndexMismatch));
        }
        self.payload.append(partial.payload)?;
        self.merkle_proof = partial.merkle_proof;
        self.certification = partial.certification;
        Ok(())
    }
pub fn append ( & mut self , partial : UnpackedStreamSlice ) -> CertifiedSliceResult < ( ) > { let messages_begin = self . payload . messages_begin ( ) ; if messages_begin . is_some ( ) { if messages_begin != partial . witness_messages_begin ( ) ? { return Err ( CertifiedSliceError :: InvalidAppend ( IndexMismatch ) ) ; } } else if ! partial . is_complete ( ) ? { return Err ( CertifiedSliceError :: InvalidAppend ( IndexMismatch ) ) ; } self . payload . append ( partial . payload ) ? ; self . merkle_proof = partial . merkle_proof ; self . certification = partial . certification ; Ok ( ( ) ) }
Appends a partial slice with a matching witness to `self`.
Appends a partial slice with a matching witness to ` self ` .
&mut self
partial
UnpackedStreamSlice