pub fn get<T: DeserializeOwned>(resource: Option<&Resource>) -> Result<T, Error>Expand description
Deserializes a resource’s JSON representation into a typed value.
Works for both the composite resource (XR) and composed resources - both
are represented by Resource. Pass req.observed.composite.as_ref()
for the observed XR, or req.observed.resources.get(name) for an
observed composed resource; the desired equivalents (rsp.desired...)
work the same way. Returns Error::MissingResource when resource is
None or has no JSON representation set, for example a composed
resource Crossplane has not yet observed.