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: lib.rs
    path of file: ./repos/sway/forc-plugins/forc-tx/src
    
    the code of the file until where you have to start completion: //! A simple tool for constructing transactions from the command line.

use clap::{Args, Parser};
use devault::Devault;
use forc_util::tx_utils::Salt;
use fuel_tx::{
    output,
    policies::{Policies, PolicyType},
    Buildable, Chargeable, ConsensusParameters,
};
use serde::{Deserialize, Serialize};
use std::path::PathBuf;
use thiserror::Error;

forc_util::cli_examples! {
    {
        // This parser has a custom parser
        super::Command::try_parse_from_args
    } {
    [ Script example => r#"forc tx script --bytecode "{path}/out/debug/name.bin" --data "{path}/data.bin" \
        --receipts-root 0x2222222222222222222222222222222222222222222222222222222222222222"# ]
    [ Multiple inputs => r#"forc tx create --bytecode "{name}/out/debug/name.bin"
        --storage-slots "{path}/out/debug/name-storage_slots.json"
        --script-gas-limit 100 \
        --gas-price 0 \
        --maturity 0 \
        --witness ADFD \
        --witness DFDA \
        input coin \
            --utxo-id 0 \
            --output-ix 0 \
            --owner 0x0000000000000000000000000000000000000000000000000000000000000000 \
            --amount 100 \
            --asset-id 0x0000000000000000000000000000000000000000000000000000000000000000 \
            --tx-ptr 89ACBDEFBDEF \
            --witness-ix 0 \
            --maturity 0 \
        input contract \
            --utxo-id 1 \
            --output-ix 1 \
            --balance-root 0x0000000000000000000000000000000000000000000000000000000000000000 \
            --state-root 0x0000000000000000000000000000000000000000000000000000000000000000 \
            --tx-ptr 89ACBDEFBDEF \
            --contract-id 0xCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC \
        output coin \
            --to 0x2222222222222222222222222222222222222222222222222222222222222222 \
            --amount 100 \
            --asset-id 0x0000000000000000000000000000000000000000000000000000000000000000 \
        output contract \
            --input-ix 1 \
            --balance-root 0x0000000000000000000000000000000000000000000000000000000000000000 \
            --state-root 0x0000000000000000000000000000000000000000000000000000000000000000 \
        output change \
            --to 0x2222222222222222222222222222222222222222222222222222222222222222 \
            --amount 100 \
            --asset-id 0x0000000000000000000000000000000000000000000000000000000000000000 \
        output variable \
            --to 0x2222222222222222222222222222222222222222222222222222222222222222 \
            --amount 100 \
            --asset-id 0x0000000000000000000000000000000000000000000000000000000000000000 \
        output contract-created \
            --contract-id 0xCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC \
            --state-root 0x0000000000000000000000000000000000000000000000000000000000000000
        "#
    ]
    [ An example constructing a create transaction => r#"forc tx create \
        --bytecode {path}/out/debug/name.bin \
        --storage-slots {path}/out/debug/name-storage_slots.json \
        --script-gas-limit 100 \
        --gas-price 0 \
        --maturity 0 \
        --witness ADFD \
        --witness DFDA \
        input coin \
            --utxo-id 0 \
            --output-ix 0 \
            --owner 0x0000000000000000000000000000000000000000000000000000000000000000 \
            --amount 100 \
            --asset-id 0x0000000000000000000000000000000000000000000000000000000000000000 \
            --tx-ptr 89ACBDEFBDEF \
            --witness-ix 0 \
            --maturity 0 \
    
    fn try_from(input: Input) -> Result<Self, Self::Error> {
        let input = match input {
            Input::Coin(coin) => {
                let InputCoin {
                    utxo_id,
                    // TODO: Should this be verified / checked in some way?
                    output_ix: _,
                    owner,
                    amount,
                    asset_id,
                    tx_ptr: tx_pointer,
                    maturity,
                    predicate_gas_used,
                    predicate,
                    witness_ix,
                } = coin;
                match (witness_ix, predicate.bytecode, predicate.data) {
                    (Some(witness_index), None, None) => fuel_tx::Input::coin_signed(
                        utxo_id,
                        owner,
                        amount,
                        asset_id,
                        tx_pointer,
                        witness_index,
                        maturity.into(),
                    ),
                    (None, Some(predicate), Some(predicate_data)) => {
                        fuel_tx::Input::coin_predicate(
                            utxo_id,
                            owner,
                            amount,
                            asset_id,
                            tx_pointer,
                            maturity.into(),
                            predicate_gas_used,
                            std::fs::read(&predicate).map_err(|err| {
                                ConvertInputError::PredicateRead {
                                    path: predicate,
                                    err,
                                }
                            })?,
                            std::fs::read(&predicate_data).map_err(|err| {
                                ConvertInputError::PredicateDataRead {
                                    path: predicate_data,
                                    err,
                                }
                            })?,
                        )
                    }
                    _ => return Err(ConvertInputError::WitnessPredicateMismatch),
                }
            }

            Input::Contract(contract) => fuel_tx::Input::contract(
                contract.utxo_id,
                contract.balance_root,
                contract.state_root,
                contract.tx_ptr,
                contract.contract_id,
            ),

            Input::Message(msg) => {
                let InputMessage {
                    sender,
                    recipient,
                    amount,
                    nonce,
                    msg_data,
                    witness_ix,
                    predicate_gas_used,
                    predicate,
                } = msg;
                let data =
                    std::fs::read(&msg_data).map_err(|err| ConvertInputError::MessageDataRead {
                        path: msg_data,
                        err,
                    })?;
                match (witness_ix, predicate.bytecode, predicate.data) {
                    (Some(witness_index), None, None) => {
                        if data.is_empty() {
                            fuel_tx::Input::message_coin_signed(
                                sender,
                                recipient,
                                amount,
                                nonce,
                                witness_index,
                            )
                        } else {
                            fuel_tx::Input::message_data_signed(
                                sender,
                                recipient,
                                amount,
                                nonce,
                                witness_index,
                                data,
                            )
                        }
                    }
                    (None, Some(predicate), Some(predicate_data)) => {
                        let predicate = std::fs::read(&predicate).map_err(|err| {
                            ConvertInputError::PredicateRead {
                                path: predicate,
                                err,
                            }
                        })?;
                        let predicate_data = std::fs::read(&predicate_data).map_err(|err| {
                            ConvertInputError::PredicateDataRead {
                                path: predicate_data,
                                err,
                            }
                        })?;

                        if data.is_empty() {
                            fuel_tx::Input::message_coin_predicate(
                                sender,
                                recipient,
                                amount,
                                nonce,
                                predicate_gas_used,
                                predicate,
                                predicate_data,
                            )
                        } else {
                            fuel_tx::Input::message_data_predicate(
                                sender,
                                recipient,
                                amount,
                                nonce,
                                predicate_gas_used,
                                data,
                                predicate,
                                predicate_data,
                            )
                        }
                    }
                    _ => return Err(ConvertInputError::WitnessPredicateMismatch),
                }
            }
        };
        Ok(input)
    }