fn make_store_element(element: Element) -> Option<(SgdOpHash, SgdOp)> {
    // Extract the data
    let (shh, element_entry) = element.into_inner();
    let (header, signature) = shh.into_header_and_signature();
    let header = header.into_content();

    // Check the entry
    let maybe_entry_box = match element_entry {
        ElementEntry::Present(e) => Some(e.into()),
        // This is ok because we weren't expecting an entry
        ElementEntry::NotApplicable | ElementEntry::Hidden => None,
        // The element is expected to have an entry but it wasn't
        // stored so we can't add this to incoming ops
        ElementEntry::NotStored => return None,
    };

    // Create the hash and op
    let op = SgdOp::StoreElement(signature, header, maybe_entry_box);
    let hash = SgdOpHash::with_data_sync(&op);
    Some((hash, op))
}
/// Make a StoreElement SgdOp from an Element.
/// Note that this can fail if the op is missing an
/// Entry when it was supposed to have one.
///
/// Because adding ops to incoming limbo while we are checking them
/// is only faster then waiting for them through gossip we don't care enough
/// to return an error.
Make a StoreElement SgdOp from an Element.
Note that this can fail if the op is missing an
Entry when it was supposed to have one.

Because adding ops to incoming limbo while we are checking them
is only faster then waiting for them through gossip we don't care enough
to return an error.
Make a StoreElement SgdOp from an Element . Note that this can fail if the op is missing an Entry when it was supposed to have one . Because adding ops to incoming limbo while we are checking them is only faster then waiting for them through gossip we don ' t care enough to return an error .
fn make_store_element(element: Element) -> Option<(SgdOpHash, SgdOp)> {
    // Extract the data
    let (shh, element_entry) = element.into_inner();
    let (header, signature) = shh.into_header_and_signature();
    let header = header.into_content();
    // Check the entry
    let maybe_entry_box = match element_entry {
        ElementEntry::Present(e) => Some(e.into()),
        // This is ok because we weren't expecting an entry
        ElementEntry::NotApplicable | ElementEntry::Hidden => None,
        // The element is expected to have an entry but it wasn't
        // stored so we can't add this to incoming ops
        ElementEntry::NotStored => return None,
    };
    // Create the hash and op
    let op = SgdOp::StoreElement(signature, header, maybe_entry_box);
    let hash = SgdOpHash::with_data_sync(&op);
    Some((hash, op))
}
fn make_store_element ( element : Element ) -> Option < ( SgdOpHash , SgdOp ) > { // Extract the data let ( shh , element_entry ) = element . into_inner ( ) ; let ( header , signature ) = shh . into_header_and_signature ( ) ; let header = header . into_content ( ) ; // Check the entry let maybe_entry_box = match element_entry { ElementEntry :: Present ( e ) => Some ( e . into ( ) ) , // This is ok because we weren't expecting an entry ElementEntry :: NotApplicable | ElementEntry :: Hidden => None , // The element is expected to have an entry but it wasn't // stored so we can't add this to incoming ops ElementEntry :: NotStored => return None , } ; // Create the hash and op let op = SgdOp :: StoreElement ( signature , header , maybe_entry_box ) ; let hash = SgdOpHash :: with_data_sync ( & op ) ; Some ( ( hash , op ) ) }
Make a StoreElement SgdOp from an Element.
Make a StoreElement SgdOp from an Element .
element
Element
element
Element