pub struct JsonValue {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
Fields§
§proc: Option<Arc<DaggerSessionProc>>
§selection: Selection
§graphql_client: DynGraphQLClient
Implementations§
Source§impl JsonValue
impl JsonValue
Sourcepub async fn as_boolean(&self) -> Result<bool, DaggerError>
pub async fn as_boolean(&self) -> Result<bool, DaggerError>
Decode a boolean from json
Sourcepub async fn as_integer(&self) -> Result<isize, DaggerError>
pub async fn as_integer(&self) -> Result<isize, DaggerError>
Decode an integer from json
Sourcepub async fn as_string(&self) -> Result<String, DaggerError>
pub async fn as_string(&self) -> Result<String, DaggerError>
Decode a string from json
Sourcepub async fn contents(&self) -> Result<Json, DaggerError>
pub async fn contents(&self) -> Result<Json, DaggerError>
Return the value encoded as json
§Arguments
opt
- optional argument, see inner type for documentation, use_opts to use
Sourcepub async fn contents_opts<'a>(
&self,
opts: JsonValueContentsOpts<'a>,
) -> Result<Json, DaggerError>
pub async fn contents_opts<'a>( &self, opts: JsonValueContentsOpts<'a>, ) -> Result<Json, DaggerError>
Return the value encoded as json
§Arguments
opt
- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue
pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue
Lookup the field at the given path, and return its value.
§Arguments
path
- Path of the field to lookup, encoded as an array of field names
Sourcepub async fn fields(&self) -> Result<Vec<String>, DaggerError>
pub async fn fields(&self) -> Result<Vec<String>, DaggerError>
List fields of the encoded object
Sourcepub async fn id(&self) -> Result<JsonValueId, DaggerError>
pub async fn id(&self) -> Result<JsonValueId, DaggerError>
A unique identifier for this JSONValue.
Sourcepub fn new_boolean(&self, value: bool) -> JsonValue
pub fn new_boolean(&self, value: bool) -> JsonValue
Sourcepub fn new_integer(&self, value: isize) -> JsonValue
pub fn new_integer(&self, value: isize) -> JsonValue
Sourcepub fn new_string(&self, value: impl Into<String>) -> JsonValue
pub fn new_string(&self, value: impl Into<String>) -> JsonValue
Sourcepub fn with_contents(&self, contents: Json) -> JsonValue
pub fn with_contents(&self, contents: Json) -> JsonValue
Return a new json value, decoded from the given content
§Arguments
contents
- New JSON-encoded contents
Sourcepub fn with_field(
&self,
path: Vec<impl Into<String>>,
value: impl IntoID<JsonValueId>,
) -> JsonValue
pub fn with_field( &self, path: Vec<impl Into<String>>, value: impl IntoID<JsonValueId>, ) -> JsonValue
Set a new field at the given path
§Arguments
path
- Path of the field to set, encoded as an array of field namesvalue
- The new value of the field
Trait Implementations§
Source§impl IntoID<JsonValueId> for JsonValue
impl IntoID<JsonValueId> for JsonValue
fn into_id( self, ) -> Pin<Box<dyn Future<Output = Result<JsonValueId, DaggerError>> + Send>>
Auto Trait Implementations§
impl Freeze for JsonValue
impl !RefUnwindSafe for JsonValue
impl Send for JsonValue
impl Sync for JsonValue
impl Unpin for JsonValue
impl !UnwindSafe for JsonValue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more