#[non_exhaustive]pub struct PartialArg {
pub json_path: String,
pub will_continue: bool,
pub delta: Option<Delta>,
/* private fields */
}data-foundry-service or gen-ai-cache-service or gen-ai-tuning-service or llm-utility-service or prediction-service or vertex-rag-service only.Expand description
Partial argument value of the function call.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.json_path: StringRequired. A JSON Path (RFC 9535) to the argument being streamed. https://datatracker.ietf.org/doc/html/rfc9535. e.g. “$.foo.bar[0].data”.
will_continue: boolOptional. Whether this is not the last part of the same json_path. If true, another PartialArg message for the current json_path is expected to follow.
delta: Option<Delta>The delta of field value being streamed.
Implementations§
Source§impl PartialArg
impl PartialArg
pub fn new() -> Self
Sourcepub fn set_json_path<T: Into<String>>(self, v: T) -> Self
pub fn set_json_path<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_will_continue<T: Into<bool>>(self, v: T) -> Self
pub fn set_will_continue<T: Into<bool>>(self, v: T) -> Self
Sourcepub fn null_value(&self) -> Option<&NullValue>
pub fn null_value(&self) -> Option<&NullValue>
The value of delta
if it holds a NullValue, None if the field is not set or
holds a different branch.
Sourcepub fn set_null_value<T: Into<NullValue>>(self, v: T) -> Self
pub fn set_null_value<T: Into<NullValue>>(self, v: T) -> Self
Sets the value of delta
to hold a NullValue.
Note that all the setters affecting delta are
mutually exclusive.
§Example
use wkt::NullValue;
let x = PartialArg::new().set_null_value(NullValue);
assert!(x.null_value().is_some());
assert!(x.number_value().is_none());
assert!(x.string_value().is_none());
assert!(x.bool_value().is_none());Sourcepub fn number_value(&self) -> Option<&f64>
pub fn number_value(&self) -> Option<&f64>
The value of delta
if it holds a NumberValue, None if the field is not set or
holds a different branch.
Sourcepub fn set_number_value<T: Into<f64>>(self, v: T) -> Self
pub fn set_number_value<T: Into<f64>>(self, v: T) -> Self
Sets the value of delta
to hold a NumberValue.
Note that all the setters affecting delta are
mutually exclusive.
§Example
let x = PartialArg::new().set_number_value(42.0);
assert!(x.number_value().is_some());
assert!(x.null_value().is_none());
assert!(x.string_value().is_none());
assert!(x.bool_value().is_none());Sourcepub fn string_value(&self) -> Option<&String>
pub fn string_value(&self) -> Option<&String>
The value of delta
if it holds a StringValue, None if the field is not set or
holds a different branch.
Sourcepub fn set_string_value<T: Into<String>>(self, v: T) -> Self
pub fn set_string_value<T: Into<String>>(self, v: T) -> Self
Sets the value of delta
to hold a StringValue.
Note that all the setters affecting delta are
mutually exclusive.
§Example
let x = PartialArg::new().set_string_value("example");
assert!(x.string_value().is_some());
assert!(x.null_value().is_none());
assert!(x.number_value().is_none());
assert!(x.bool_value().is_none());Sourcepub fn bool_value(&self) -> Option<&bool>
pub fn bool_value(&self) -> Option<&bool>
The value of delta
if it holds a BoolValue, None if the field is not set or
holds a different branch.
Sourcepub fn set_bool_value<T: Into<bool>>(self, v: T) -> Self
pub fn set_bool_value<T: Into<bool>>(self, v: T) -> Self
Sets the value of delta
to hold a BoolValue.
Note that all the setters affecting delta are
mutually exclusive.
§Example
let x = PartialArg::new().set_bool_value(true);
assert!(x.bool_value().is_some());
assert!(x.null_value().is_none());
assert!(x.number_value().is_none());
assert!(x.string_value().is_none());Trait Implementations§
Source§impl Clone for PartialArg
impl Clone for PartialArg
Source§fn clone(&self) -> PartialArg
fn clone(&self) -> PartialArg
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more