Expand description
Implementations of Toml cheatcodes.
Re-exportsยง
use crate::Cheatcode;๐use crate::CheatcodesCore;๐use crate::Result;๐use crate::json::check_json_key_exists;๐use crate::json::parse_json;๐use crate::json::parse_json_coerce;๐use crate::json::parse_json_coerce_default;๐use crate::json::parse_json_keys;๐use crate::json::resolve_type;๐use crate::json::split_value_key;๐use alloy_dyn_abi::DynSolType;๐use alloy_sol_types::SolValue;๐use foundry_common::fmt::StructDefinitions;๐use foundry_common::fs;๐use foundry_config::fs_permissions::FsAccessKind;๐use serde_json::Value as JsonValue;๐use toml::Value as TomlValue;๐use toml_edit::DocumentMut;๐use toml_edit::Item;๐use toml_edit::Table;๐use toml_edit::TableLike;๐use crate::Vm::*;๐
Macrosยง
- impl_
parse_ ๐toml
Functionsยง
- format_
json_ ๐to_ toml - Format a JSON value to a TOML pretty string.
- insert_
toml_ ๐item - Inserts a new
itematkeyintoparent. - json_
to_ ๐toml_ item - Converts a JSON value to a TOML item, formatted the same way as
format_json_to_toml. - json_
to_ ๐toml_ value - Convert a JSON value to a TOML value.
- parse_
toml ๐ - Parse a TOML string and return the value at the given path.
- parse_
toml_ ๐coerce - Parse a TOML string and return the value at the given path, coercing it to the given type.
- parse_
toml_ ๐coerce_ default - Parse a TOML string and return the value at the given path, coercing it to the given type, or return the default if the path does not exist.
- parse_
toml_ ๐document - Parses a TOML string into a document that keeps its formatting and comments.
- parse_
toml_ ๐keys - Parse a TOML string and return an array of all keys at the given path.
- parse_
toml_ ๐str - Parse
- reset_
table_ ๐layout - Recursively clears the document position and header whitespace of all tables in
item. - tables ๐
- Returns the tables of
itemthat are written with a header. - tables_
mut ๐ - Returns the tables of
itemthat are written with a header. - toml_
to_ ๐json_ string - Convert a TOML string to a JSON string.
- toml_
to_ ๐json_ value - Convert a TOML value to a JSON value.
- upsert_
toml_ ๐value - Inserts or replaces the value at
keyin a TOML document, creating intermediate tables if necessary.