dagger/dsl/j_s_o_n_value
Types
pub type ForContents
Values
pub fn as_array(
parent: types.JSONValue,
select select: fn(types.JSONValue) -> List(types.Field),
client client: types.Client,
then handler: fn(
Result(List(types.JSONValue), types.QueryError),
) -> a,
) -> a
Decode an array from json
pub fn as_boolean(
parent: types.JSONValue,
client client: types.Client,
then handler: fn(Result(Bool, types.QueryError)) -> a,
) -> a
Decode a boolean from json
pub fn as_integer(
parent: types.JSONValue,
client client: types.Client,
then handler: fn(Result(Int, types.QueryError)) -> a,
) -> a
Decode an integer from json
pub fn as_string(
parent: types.JSONValue,
client client: types.Client,
then handler: fn(Result(String, types.QueryError)) -> a,
) -> a
Decode a string from json
pub fn contents(
parent: types.JSONValue,
with with_fn: fn(Opts(ForContents)) -> Opts(ForContents),
client client: types.Client,
then handler: fn(Result(String, types.QueryError)) -> a,
) -> a
Return the value encoded as json
pub fn field(
parent: types.JSONValue,
path path: List(String),
) -> types.JSONValue
Lookup the field at the given path, and return its value.
pub fn fields(
parent: types.JSONValue,
client client: types.Client,
then handler: fn(Result(List(String), types.QueryError)) -> a,
) -> a
List fields of the encoded object
pub fn id(parent: types.JSONValue) -> types.JSONValue
A unique identifier for this JSONValue.
pub fn j_s_o_n_value() -> types.JSONValue
pub fn new_boolean(
parent: types.JSONValue,
value value: Bool,
) -> types.JSONValue
Encode a boolean to json
pub fn new_integer(
parent: types.JSONValue,
value value: Int,
) -> types.JSONValue
Encode an integer to json
pub fn new_string(
parent: types.JSONValue,
value value: String,
) -> types.JSONValue
Encode a string to json
pub fn opt_indent(
opts: Opts(ForContents),
val: String,
) -> Opts(ForContents)
pub fn opt_pretty(
opts: Opts(ForContents),
val: Bool,
) -> Opts(ForContents)
pub fn with_contents(
parent: types.JSONValue,
contents contents: String,
) -> types.JSONValue
Return a new json value, decoded from the given content
pub fn with_field(
parent: types.JSONValue,
path path: List(String),
value value: types.JSONValue,
) -> types.JSONValue
Set a new field at the given path