You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: commitment.rs
    path of file: ./repos/nox/crates/chain-types/src
    
    the code of the file until where you have to start completion: use crate::commitment_status::CommitmentStatus;
use chain_data::{next_opt, parse_chain_data, ChainDataError};
use ethabi::ethereum_types::U256;
use ethabi::{ParamType, Token};

///    struct CommitmentView {
///         CCStatus status;
///         bytes32 peerId;
///         uint256 collateralPerUnit;
///         uint256 unitCount;
///         uint256 startEpoch;
///         uint256 endEpoch;
///         uint256 rewardDelegatorRate;
///         address delegator;
///         uint256 totalCUFailCount;
///         uint256 failedE
    
    pub fn from(data: &str) -> Result<Self, ChainDataError> {
        let mut tokens = parse_chain_data(data, &Self::signature())?.into_iter();
        let status = next_opt(
            &mut tokens,
            "commitment_status",
            CommitmentStatus::from_token,
        )?;
        let mut tokens = tokens.skip(3);
        let start_epoch = next_opt(&mut tokens, "start_epoch", Token::into_uint)?;
        let end_epoch = next_opt(&mut tokens, "end_epoch", Token::into_uint)?;
        Ok(Commitment {
            status,
            start_epoch,
            end_epoch,
        })
    }