pub fn from_wire_elements<I: IntoIterator<Item = WireHeaderStatus<WireNewEntryHeader>>>(
        headers_iter: I,
        entry_type: EntryType,
        entry: Entry,
    ) -> ElementGroupResult<ElementGroup<'a>> {
        let iter = headers_iter.into_iter();
        let mut valid = Vec::with_capacity(iter.size_hint().0);
        let mut rejected = Vec::with_capacity(iter.size_hint().0);
        let entry = EntryHashed::from_content_sync(entry);
        let entry_hash = entry.as_hash().clone();
        let entry = Cow::Owned(entry);
        for wire in iter {
            match wire.validation_status {
                ValidationStatus::Valid => valid.push(Cow::Owned(
                    wire.header
                        .into_header(entry_type.clone(), entry_hash.clone()),
                )),
                ValidationStatus::Rejected => rejected.push(Cow::Owned(
                    wire.header
                        .into_header(entry_type.clone(), entry_hash.clone()),
                )),
                ValidationStatus::Abandoned => todo!(),
            }
        }

        Ok(Self {
            headers: valid,
            rejected,
            entry,
        })
    }
/// Create an element group from wire headers and an entry
Create an element group from wire headers and an entry
Create an element group from wire headers and an entry
pub fn from_wire_elements<I: IntoIterator<Item = WireHeaderStatus<WireNewEntryHeader>>>(
        headers_iter: I,
        entry_type: EntryType,
        entry: Entry,
    ) -> ElementGroupResult<ElementGroup<'a>> {
        let iter = headers_iter.into_iter();
        let mut valid = Vec::with_capacity(iter.size_hint().0);
        let mut rejected = Vec::with_capacity(iter.size_hint().0);
        let entry = EntryHashed::from_content_sync(entry);
        let entry_hash = entry.as_hash().clone();
        let entry = Cow::Owned(entry);
        for wire in iter {
            match wire.validation_status {
                ValidationStatus::Valid => valid.push(Cow::Owned(
                    wire.header
                        .into_header(entry_type.clone(), entry_hash.clone()),
                )),
                ValidationStatus::Rejected => rejected.push(Cow::Owned(
                    wire.header
                        .into_header(entry_type.clone(), entry_hash.clone()),
                )),
                ValidationStatus::Abandoned => todo!(),
            }
        }
        Ok(Self {
            headers: valid,
            rejected,
            entry,
        })
    }
pub fn from_wire_elements < I : IntoIterator < Item = WireHeaderStatus < WireNewEntryHeader > > > ( headers_iter : I , entry_type : EntryType , entry : Entry , ) -> ElementGroupResult < ElementGroup < ' a > > { let iter = headers_iter . into_iter ( ) ; let mut valid = Vec :: with_capacity ( iter . size_hint ( ) . 0 ) ; let mut rejected = Vec :: with_capacity ( iter . size_hint ( ) . 0 ) ; let entry = EntryHashed :: from_content_sync ( entry ) ; let entry_hash = entry . as_hash ( ) . clone ( ) ; let entry = Cow :: Owned ( entry ) ; for wire in iter { match wire . validation_status { ValidationStatus :: Valid => valid . push ( Cow :: Owned ( wire . header . into_header ( entry_type . clone ( ) , entry_hash . clone ( ) ) , ) ) , ValidationStatus :: Rejected => rejected . push ( Cow :: Owned ( wire . header . into_header ( entry_type . clone ( ) , entry_hash . clone ( ) ) , ) ) , ValidationStatus :: Abandoned => todo ! ( ) , } } Ok ( Self { headers : valid , rejected , entry , } ) }
Create an element group from wire headers and an entry
Create an element group from wire headers and an entry
headers_iter
I
entry_type
EntryType
entry
Entry
headers_iter
I
entry_type
EntryType
entry
Entry