### ImplementationGuideManifestResource Struct Definition Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ImplementationGuideManifestResource.html Defines the structure for a resource included in an implementation guide, specifying its reference, example status, profiles, and relative path. ```rust pub struct ImplementationGuideManifestResource { pub id: Option, pub extension: Vec, pub modifier_extension: Vec, pub reference: Box, pub is_example: Option, pub profile: Vec, pub relative_path: Option, } ``` -------------------------------- ### Example Usage of from_element Source: https://docs.rs/fhirbolt/latest/fhirbolt/serde/element/fn.from_element.html Demonstrates converting a JSON string into a FHIR Element and then into a Rust Resource type using `from_element`. This example shows how to handle known and unknown resource types. ```rust // The `Resource` type is an enum that contains all possible FHIR resources. // If the resource type is known in advance, you could also use a concrete resource type // (like e.g. `fhirbolt::model::r4b::resources::Observation`). use fhirbolt::FhirReleases; use fhirbolt::element::Element; use fhirbolt::model::r4b::Resource; use fhirbolt::serde::{DeserializationConfig, DeserializationMode}; // The type of `s` is `&str` let s = r#"{ "resourceType": "Observation", "status": "final", "code": { "text": "some code" }, "valueString": "some value" }"#; let e: Element<{FhirReleases::R4B }> = fhirbolt::json::from_str(s, None).unwrap(); let r: Resource = fhirbolt::element::from_element(e, None).unwrap(); println!("{:?}", r); ``` -------------------------------- ### ImplementationGuideDependsOn Struct Definition Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ImplementationGuideDependsOn.html Defines the structure for an implementation guide dependency, including fields for URI, package ID, version, and reason. ```rust pub struct ImplementationGuideDependsOn { pub id: Option, pub extension: Vec, pub modifier_extension: Vec, pub uri: Canonical, pub package_id: Option, pub version: Option, pub reason: Option, } ``` -------------------------------- ### Creating an Element Instance Source: https://docs.rs/fhirbolt/latest/fhirbolt/element/macro.Element.html Example of using the Element macro to create an Element with a string primitive value. ```rust use fhirbolt::FhirReleases; use fhirbolt::element::{Element, Value, Primitive}; let element: Element<{ FhirReleases::R4 }> = Element! { "value" => Value::Primitive(Primitive::String("123".into())), }; ``` -------------------------------- ### ImplementationGuideManifest Struct Definition Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ImplementationGuideManifest.html Defines the structure for an assembled implementation guide, including fields for ID, extensions, rendering, resources, pages, images, and other files. ```rust pub struct ImplementationGuideManifest { pub id: Option, pub extension: Vec, pub modifier_extension: Vec, pub rendering: Option, pub resource: Vec, pub page: Vec, pub image: Vec, pub other: Vec, } ``` -------------------------------- ### ImplementationGuideDefinitionGrouping Struct Definition Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ImplementationGuideDefinitionGrouping.html Defines a logical group of resources for rendering in an implementation guide. Includes fields for ID, extensions, name, and description. ```rust pub struct ImplementationGuideDefinitionGrouping { pub id: Option, pub extension: Vec, pub modifier_extension: Vec, pub name: String, pub description: Option, } ``` -------------------------------- ### Rust Into Trait Example Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.SubstanceSourceMaterialOrganismHybrid.html Demonstrates the `Into` trait, which provides a reverse conversion from `From`. It calls the corresponding `From::from` implementation. ```rust impl Into for T where U: From { fn into(self) -> U { U::from(self) } } ``` -------------------------------- ### ImplementationGuideManifestPage Struct Definition Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ImplementationGuideManifestPage.html Defines the structure for a page within an Implementation Guide, including its ID, extensions, name, title, and anchors. ```rust pub struct ImplementationGuideManifestPage { pub id: Option, pub extension: Vec, pub modifier_extension: Vec, pub name: String, pub title: Option, pub anchor: Vec, } ``` -------------------------------- ### Rust Into Trait Example Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.VerificationResultPrimarySource.html Demonstrates the `into` method, which converts a type into another type that implements `From` for the original type. ```rust impl Into for T where U: From, { fn into(self) -> U } ``` -------------------------------- ### ImplementationGuideDefinitionParameter Struct Definition Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ImplementationGuideDefinitionParameter.html Defines the structure for parameters used in building an implementation guide. Includes fields for id, extensions, a code for the parameter, and its value. ```rust pub struct ImplementationGuideDefinitionParameter { pub id: Option, pub extension: Vec, pub modifier_extension: Vec, pub code: Box, pub value: String, } ``` -------------------------------- ### Unchecked unwrap of Ok Result Source: https://docs.rs/fhirbolt/latest/fhirbolt/serde/element/error/type.Result.html Example of using `unwrap_unchecked` to get the `Ok` value. This is unsafe and requires the caller to guarantee the `Result` is `Ok`. ```rust let x: Result = Ok(2); assert_eq!(unsafe { x.unwrap_unchecked() }, 2); ``` -------------------------------- ### TryInto for ImplementationGuideManifestPage Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ImplementationGuideManifestPage.html Provides the ability to convert an ImplementationGuideManifestPage into a type U, where U can be converted from T. This is a fallible conversion, returning a Result. ```APIDOC ## impl TryInto for T where U: TryFrom, ### Description Provides the ability to convert an ImplementationGuideManifestPage into a type U, where U can be converted from T. This is a fallible conversion, returning a Result. ### Type Alias #### Error - **Error** (>::Error) - The type returned in the event of a conversion error. ### Method #### try_into - **self**: T - The ImplementationGuideManifestPage instance to convert. - **Returns**: Result>::Error> - A Result containing the converted type U or an error. ``` -------------------------------- ### TryFrom for ImplementationGuideManifestPage Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ImplementationGuideManifestPage.html Provides the ability to convert a type U into an ImplementationGuideManifestPage, where U can be converted into T. This is a fallible conversion, returning a Result. ```APIDOC ## impl TryFrom for T where U: Into, ### Description Provides the ability to convert a type U into an ImplementationGuideManifestPage, where U can be converted into T. This is a fallible conversion, returning a Result. ### Type Alias #### Error - **Error** (Infallible) - The type returned in the event of a conversion error. ### Method #### try_from - **value**: U - The value to convert. - **Returns**: Result>::Error> - A Result containing the converted ImplementationGuideManifestPage or an error. ``` -------------------------------- ### From Trait Implementation for ExampleScenarioProcess Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ExampleScenarioProcess.html Allows conversion into an ExampleScenarioProcess from itself. ```rust impl From for T fn from(t: T) -> T ``` -------------------------------- ### Default Implementation for SearchParameterVersionAlgorithm Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/enum.SearchParameterVersionAlgorithm.html Provides the `default` method to get the default value for SearchParameterVersionAlgorithm. ```rust fn default() -> SearchParameterVersionAlgorithm ``` -------------------------------- ### Any Trait Implementation for ExampleScenarioProcess Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ExampleScenarioProcess.html Allows ExampleScenarioProcess instances to be treated as dynamically typed trait objects. ```rust impl Any for T where T: 'static + ?Sized, fn type_id(&self) -> TypeId ``` -------------------------------- ### Borrow Implementation for ExampleScenarioProcessStep Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ExampleScenarioProcessStep.html Allows borrowing a reference to ExampleScenarioProcessStep. ```rust impl Borrow where T: ?Sized, fn borrow(&self) -> &T ``` -------------------------------- ### get Source: https://docs.rs/fhirbolt/latest/fhirbolt/element/struct.Element.html Retrieves a reference to the value associated with the given key, or `None` if the key is not present. ```APIDOC ## pub fn get(&self, key: &Q) -> Option<&V> ### Description Returns a reference to the value stored for `key`, if it is present, else `None`. ### Method `get` ### Parameters #### Path Parameters - `key` (&Q) - The key to look up. #### Return Value - `Option<&V>` - An optional reference to the value. ``` -------------------------------- ### Default Implementation for ExampleScenarioProcessStep Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ExampleScenarioProcessStep.html Provides a default value for ExampleScenarioProcessStep, typically an empty or zero-initialized instance. ```rust impl Default for ExampleScenarioProcessStep fn default() -> ExampleScenarioProcessStep ``` -------------------------------- ### Default Implementation for ClaimResponseEventWhen Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/enum.ClaimResponseEventWhen.html Provides the `default` method to get the default value for ClaimResponseEventWhen. ```rust fn default() -> ClaimResponseEventWhen ``` -------------------------------- ### Get FHIR Element Hasher Source: https://docs.rs/fhirbolt/latest/fhirbolt/element/struct.Element.html Returns a reference to the map's BuildHasher for the FHIR Element. ```rust pub fn hasher(&self) -> &S ``` -------------------------------- ### Get FHIR Element Capacity Source: https://docs.rs/fhirbolt/latest/fhirbolt/element/struct.Element.html Retrieves the current capacity of the FHIR Element in O(1) time. ```rust pub fn capacity(&self) -> usize ``` -------------------------------- ### CloneToUninit Trait Implementation for ExampleScenarioProcess Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ExampleScenarioProcess.html Provides an experimental (nightly-only) way to copy ExampleScenarioProcess instances to uninitialized memory. ```rust impl CloneToUninit for T where T: Clone, unsafe fn clone_to_uninit(&self, dest: *mut u8) ``` -------------------------------- ### TestScriptSetupAction Struct Definition Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.TestScriptSetupAction.html Defines the structure for a TestScript setup action, which can include an operation or an assertion. ```rust pub struct TestScriptSetupAction { pub id: Option, pub extension: Vec, pub modifier_extension: Vec, pub operation: Option, pub assert: Option, } ``` -------------------------------- ### Default Implementation for ExampleScenarioActor Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ExampleScenarioActor.html Provides a default value for ExampleScenarioActor, useful for initialization. ```rust fn default() -> ExampleScenarioActor ``` -------------------------------- ### Rust TryFrom Trait Example Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.VerificationResultPrimarySource.html Demonstrates the `try_from` method for fallible type conversions, returning a `Result`. ```rust impl TryFrom for T where U: Into, { type Error = Infallible; fn try_from(value: U) -> Result>::Error> } ``` -------------------------------- ### StructuralPartialEq Implementation for ExampleScenarioProcessStep Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ExampleScenarioProcessStep.html Indicates that ExampleScenarioProcessStep implements structural partial equality. ```rust impl StructuralPartialEq for ExampleScenarioProcessStep ``` -------------------------------- ### Clone Implementation for ExampleScenarioProcessStep Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ExampleScenarioProcessStep.html Provides the ability to create a duplicate of an ExampleScenarioProcessStep instance. ```rust impl Clone for ExampleScenarioProcessStep fn clone(&self) -> ExampleScenarioProcessStep ``` -------------------------------- ### ExampleScenario Struct Definition Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ExampleScenario.html Defines the ExampleScenario resource, which provides a walkthrough of a workflow showing system interactions and instance evolution. ```rust pub struct ExampleScenario { pub id: Option, pub meta: Option>, pub implicit_rules: Option, pub language: Option, pub text: Option>, pub contained: Vec, pub extension: Vec, pub modifier_extension: Vec, pub url: Option, pub identifier: Vec, pub version: Option, pub version_algorithm: Option, pub name: Option, pub title: Option, pub status: Code, pub experimental: Option, pub date: Option, pub publisher: Option, pub contact: Vec, pub description: Option, pub use_context: Vec, pub jurisdiction: Vec, pub purpose: Option, pub copyright: Option, pub copyright_label: Option, pub actor: Vec, pub instance: Vec, pub process: Vec, } ``` -------------------------------- ### Get FHIR Element Length Source: https://docs.rs/fhirbolt/latest/fhirbolt/element/struct.Element.html Returns the number of key-value pairs in the FHIR Element in O(1) time. ```rust pub fn len(&self) -> usize ``` -------------------------------- ### PartialEq Implementation for ExampleScenarioActor Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ExampleScenarioActor.html Enables comparison for equality between two ExampleScenarioActor instances. ```rust fn eq(&self, other: &ExampleScenarioActor) -> bool ``` -------------------------------- ### Rust From Trait Example Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.SubstanceSourceMaterialOrganismHybrid.html Illustrates the `From` trait, which enables direct conversion into a type. The `from` function returns the argument unchanged. ```rust impl From for T { fn from(t: T) -> T { t } } ``` -------------------------------- ### Default Trait Implementation for ExampleScenarioInstanceVersion Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ExampleScenarioInstanceVersion.html Provides a default value for ExampleScenarioInstanceVersion, allowing for easy initialization. ```rust impl Default for ExampleScenarioInstanceVersion { fn default() -> ExampleScenarioInstanceVersion { // ... implementation details ... } } ``` -------------------------------- ### Rust BorrowMut Trait Example Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.SubstanceSourceMaterialOrganismHybrid.html Demonstrates mutable borrowing of an owned value. This is a core trait for in-place modification. ```rust impl BorrowMut for T where T: ?Sized, { fn borrow_mut(&mut self) -> &mut T { self } } ``` -------------------------------- ### Default Trait Implementation for ExampleScenarioInstance Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ExampleScenarioInstance.html Provides a default value for ExampleScenarioInstance, allowing for easy initialization. ```rust impl Default for ExampleScenarioInstance fn default() -> ExampleScenarioInstance ``` -------------------------------- ### Provide Default with unwrap_or() Source: https://docs.rs/fhirbolt/latest/fhirbolt/serde/element/type.Result.html Use `unwrap_or()` to get the Ok value or a provided default. The default is eagerly evaluated. ```rust let default = 2; let x: Result = Ok(9); assert_eq!(x.unwrap_or(default), 9); ``` ```rust let x: Result = Err("error"); assert_eq!(x.unwrap_or(default), default); ``` -------------------------------- ### Serialize Newtype Struct Source: https://docs.rs/fhirbolt/latest/fhirbolt/serde/xml/ser/struct.Serializer.html Serializes a newtype struct, which is a tuple struct with a single field. Example: `struct Millimeters(u8)`. ```rust fn serialize_newtype_struct( self, _name: &'static str, _value: &T, ) -> Result<<&'a mut Serializer as Serializer>::Ok, Error> where T: Serialize + ?Sized, ``` -------------------------------- ### PartialEq Implementation for ExampleScenarioProcessStep Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ExampleScenarioProcessStep.html Tests for equality between two ExampleScenarioProcessStep instances. ```rust impl PartialEq for ExampleScenarioProcessStep fn eq(&self, other: &ExampleScenarioProcessStep) -> bool ``` -------------------------------- ### Default Trait Implementation for ExampleScenarioProcess Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ExampleScenarioProcess.html Provides a default value for ExampleScenarioProcess, useful for initialization. ```rust impl Default for ExampleScenarioProcess { fn default() -> ExampleScenarioProcess } ``` -------------------------------- ### ElementDefinitionExample Struct Definition Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/types/struct.ElementDefinitionExample.html Defines the structure of an example value for a FHIR element, including its ID, extensions, label, and value. ```rust pub struct ElementDefinitionExample { pub id: Option, pub extension: Vec, pub label: String, pub value: ElementDefinitionExampleValue, } ``` -------------------------------- ### PartialEq Trait Implementation for ImplementationGuideManifest Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ImplementationGuideManifest.html Enables equality comparison between two ImplementationGuideManifest instances. ```rust fn eq(&self, other: &ImplementationGuideManifest) -> bool ``` -------------------------------- ### Period Struct Definition Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/types/struct.Period.html Defines the Period structure for FHIR R5, including optional start and end date-time fields. ```rust pub struct Period { pub id: Option, pub extension: Vec, pub start: Option, pub end: Option, } ``` -------------------------------- ### SubstancePolymerMonomerSet Struct Definition Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.SubstancePolymerMonomerSet.html Defines the structure for SubstancePolymerMonomerSet, including fields for ID, extensions, ratio type, and starting materials. ```rust pub struct SubstancePolymerMonomerSet { pub id: Option, pub extension: Vec, pub modifier_extension: Vec, pub ratio_type: Option>, pub starting_material: Vec, } ``` -------------------------------- ### StructuralPartialEq Trait Implementation for ExampleScenarioInstance Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ExampleScenarioInstance.html Indicates that ExampleScenarioInstance supports structural partial equality comparison. ```rust impl StructuralPartialEq for ExampleScenarioInstance ``` -------------------------------- ### Unchecked unwrap_err of Err Result Source: https://docs.rs/fhirbolt/latest/fhirbolt/serde/element/error/type.Result.html Example of safely using `unwrap_err_unchecked` to retrieve the `Err` value. This is unsafe and requires the `Result` to be `Err`. ```rust let x: Result = Err("emergency failure"); assert_eq!(unsafe { x.unwrap_err_unchecked() }, "emergency failure"); ``` -------------------------------- ### CloneToUninit Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ExampleScenarioInstance.html An experimental nightly-only API for performing copy-assignment from `self` to a raw pointer `dest`. Use with caution. ```APIDOC ## unsafe fn clone_to_uninit(&self, dest: *mut u8) ### Description Performs copy-assignment from `self` to `dest`. ### Method `clone_to_uninit` ### Parameters - `dest` (*mut u8): A raw pointer to the destination memory location. ### Safety This function is unsafe and requires the caller to ensure that `dest` is a valid, properly aligned, and sufficiently large memory location to hold a copy of `self`. ``` -------------------------------- ### Serialize Newtype Variant Source: https://docs.rs/fhirbolt/latest/fhirbolt/serde/xml/ser/struct.Serializer.html Serializes a newtype variant within an enum. Example: `E::N` in `enum E { N(u8) }`. ```rust fn serialize_newtype_variant( self, _name: &'static str, _variant_present: u32, _variant: &'static str, _value: &T, ) -> Result<<&'a mut Serializer as Serializer>::Ok, Error> where T: Serialize + ?Sized, ``` -------------------------------- ### SubstancePolymerMonomerSetStartingMaterial Struct Definition Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.SubstancePolymerMonomerSetStartingMaterial.html Defines the structure for a starting material in polymer synthesis, including its code, category, defining status, and amount. ```rust pub struct SubstancePolymerMonomerSetStartingMaterial { pub id: Option, pub extension: Vec, pub modifier_extension: Vec, pub code: Option>, pub category: Option>, pub is_defining: Option, pub amount: Option>, } ``` -------------------------------- ### Into Trait Implementation for ExampleScenarioProcess Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ExampleScenarioProcess.html Enables conversion from an ExampleScenarioProcess to another type that implements From. ```rust impl Into for T where U: From, fn into(self) -> U ``` -------------------------------- ### PartialEq Trait Implementation for ExampleScenarioInstanceVersion Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ExampleScenarioInstanceVersion.html Enables comparison for equality between two ExampleScenarioInstanceVersion instances. ```rust impl PartialEq for ExampleScenarioInstanceVersion { fn eq(&self, other: &ExampleScenarioInstanceVersion) -> bool { // ... implementation details ... } } ``` -------------------------------- ### ExampleScenarioInstance Struct Definition Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ExampleScenarioInstance.html Defines the structure of an ExampleScenarioInstance, including fields for ID, extensions, key, structure type, title, description, content reference, versions, and contained instances. ```rust pub struct ExampleScenarioInstance { pub id: Option, pub extension: Vec, pub modifier_extension: Vec, pub key: String, pub structure_type: Box, pub structure_version: Option, pub structure_profile: Option, pub title: String, pub description: Option, pub content: Option>, pub version: Vec, pub contained_instance: Vec, } ``` -------------------------------- ### TestScriptSetupActionOperation Struct Definition Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.TestScriptSetupActionOperation.html Defines the structure for an operation within a TestScript setup. Includes fields for operation type, resource, method, headers, and more. ```rust pub struct TestScriptSetupActionOperation { pub id: Option, pub extension: Vec, pub modifier_extension: Vec, pub type: Option>, pub resource: Option, pub label: Option, pub description: Option, pub accept: Option, pub content_type: Option, pub destination: Option, pub encode_request_url: Boolean, pub method: Option, pub origin: Option, pub params: Option, pub request_header: Vec, pub request_id: Option, pub response_id: Option, pub source_id: Option, pub target_id: Option, pub url: Option, } ``` -------------------------------- ### PartialEq Trait Implementation for ImplementationGuideDefinition Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ImplementationGuideDefinition.html Enables comparison for equality between two ImplementationGuideDefinition instances. ```rust fn eq(&self, other: &ImplementationGuideDefinition) -> bool ``` ```rust const fn ne(&self, other: &Rhs) -> bool ``` -------------------------------- ### TestReportSetupAction Struct Definition Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.TestReportSetupAction.html Defines the TestReportSetupAction struct, which represents an action within a test report setup. It can contain either an operation or an assertion. ```rust pub struct TestReportSetupAction { pub id: Option, pub extension: Vec, pub modifier_extension: Vec, pub operation: Option, pub assert: Option, } ``` -------------------------------- ### Debug Implementation for ExampleScenarioProcessStep Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ExampleScenarioProcessStep.html Formats the ExampleScenarioProcessStep value for debugging purposes. ```rust impl Debug for ExampleScenarioProcessStep fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error> ``` -------------------------------- ### StructuralPartialEq Trait Implementation for ExampleScenarioInstanceVersion Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ExampleScenarioInstanceVersion.html Indicates that ExampleScenarioInstanceVersion supports structural partial equality comparison. ```rust impl StructuralPartialEq for ExampleScenarioInstanceVersion {} ``` -------------------------------- ### TestReportSetupActionOperation Struct Definition Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.TestReportSetupActionOperation.html Defines the structure for an operation performed during a test report setup, including fields for ID, extensions, result, message, and detail. ```rust pub struct TestReportSetupActionOperation { pub id: Option, pub extension: Vec, pub modifier_extension: Vec, pub result: Code, pub message: Option, pub detail: Option, } ``` -------------------------------- ### Create FHIR Element Using Macro Source: https://docs.rs/fhirbolt/latest/fhirbolt/element/struct.Element.html Demonstrates creating a FHIR Element using the recommended Element! macro for FHIR R4. ```rust use fhirbolt::FhirReleases; use fhirbolt::element::{Element, Value, Primitive}; let element: Element<{FhirReleases::R4 }> = Element! { "value" => Value::Primitive(Primitive::String("123".into())), }; ``` -------------------------------- ### MolecularSequenceRelativeEdit Struct Definition Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.MolecularSequenceRelativeEdit.html Defines the structure for representing edits or changes within a molecular sequence, including start and end positions, and the replaced/replacement sequences. ```rust pub struct MolecularSequenceRelativeEdit { pub id: Option, pub extension: Vec, pub modifier_extension: Vec, pub start: Option, pub end: Option, pub replacement_sequence: Option, pub replaced_sequence: Option, } ``` -------------------------------- ### PartialEq Trait Implementation for ExampleScenarioProcess Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ExampleScenarioProcess.html Enables comparison for equality between two ExampleScenarioProcess instances. ```rust impl PartialEq for ExampleScenarioProcess { fn eq(&self, other: &ExampleScenarioProcess) -> bool } ``` -------------------------------- ### SerializeResource Trait Implementor Context Type Source: https://docs.rs/fhirbolt/latest/fhirbolt/serde/trait.SerializeResource.html Specifies the associated `Context` type for implementations of the SerializeResource trait. This example shows the context type for a generic implementation. ```rust type Context<'a> = SerializationContext<&'a T> where T: 'a ``` -------------------------------- ### PartialEq Implementation for ExplanationOfBenefitSupportingInfo Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ExplanationOfBenefitSupportingInfo.html Enables comparison for equality between two ExplanationOfBenefitSupportingInfo instances. ```rust fn eq(&self, other: &ExplanationOfBenefitSupportingInfo) -> bool ``` -------------------------------- ### Clone Implementation for ExampleScenarioActor Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ExampleScenarioActor.html Provides the ability to create a duplicate of an ExampleScenarioActor instance. ```rust fn clone(&self) -> ExampleScenarioActor ``` -------------------------------- ### Example: Handling IO Error Kind Source: https://docs.rs/fhirbolt/latest/fhirbolt/serde/json/error/struct.Error.html Demonstrates how to check for specific IO error kinds, such as 'TimedOut', when deserializing JSON. This is useful for implementing retry logic. ```rust use serde_json::Value; use std::io::{self, ErrorKind, Read}; use std::process; struct ReaderThatWillTimeOut<'a>(&'a [u8]); impl<'a> Read for ReaderThatWillTimeOut<'a> { fn read(&mut self, buf: &mut [u8]) -> io::Result { if self.0.is_empty() { Err(io::Error::new(ErrorKind::TimedOut, "timed out")) } else { self.0.read(buf) } } } fn main() { let reader = ReaderThatWillTimeOut(br#" {"k": "#); let _: Value = match serde_json::from_reader(reader) { Ok(value) => value, Err(error) => { if error.io_error_kind() == Some(ErrorKind::TimedOut) { // Maybe this application needs to retry certain kinds of errors. } else { eprintln!("error: {}", error); process::exit(1); } } }; } ``` -------------------------------- ### Rust TryInto Trait Example Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.SubstanceSourceMaterialOrganismHybrid.html Demonstrates the `TryInto` trait, the fallible counterpart to `Into`. It returns a `Result` and uses the error type defined by the corresponding `TryFrom` implementation. ```rust type Error = >::Error; fn try_into(self) -> Result>::Error> where U: TryFrom ``` -------------------------------- ### Unchecked Err Value Access Source: https://docs.rs/fhirbolt/latest/fhirbolt/serde/element/type.Result.html Use `unwrap_err_unchecked()` to get the Err value without checking for Ok. This is unsafe and can lead to undefined behavior if called on an Ok. ```rust let x: Result = Ok(2); unsafe { x.unwrap_err_unchecked() }; // Undefined behavior! ``` ```rust let x: Result = Err("emergency failure"); assert_eq!(unsafe { x.unwrap_err_unchecked() }, "emergency failure"); ``` -------------------------------- ### Unchecked Ok Value Access Source: https://docs.rs/fhirbolt/latest/fhirbolt/serde/element/type.Result.html Use `unwrap_unchecked()` to get the Ok value without checking for Err. This is unsafe and can lead to undefined behavior if called on an Err. ```rust let x: Result = Ok(2); assert_eq!(unsafe { x.unwrap_unchecked() }, 2); ``` ```rust let x: Result = Err("emergency failure"); unsafe { x.unwrap_unchecked(); } // Undefined behavior! ``` -------------------------------- ### CloneToUninit Implementation (Nightly) Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ClinicalUseDefinitionIndication.html Performs copy-assignment from self to a raw pointer destination. This is a nightly-only experimental API. ```rust unsafe fn clone_to_uninit(&self, dest: *mut u8) where T: Clone, ``` -------------------------------- ### PartialEq Trait Implementation for ExampleScenarioInstance Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.ExampleScenarioInstance.html Enables equality comparison between two ExampleScenarioInstance instances. ```rust impl PartialEq for ExampleScenarioInstance fn eq(&self, other: &ExampleScenarioInstance) -> bool const fn ne(&self, other: &Rhs) -> bool ``` -------------------------------- ### PlanDefinitionGoal Struct Definition Source: https://docs.rs/fhirbolt/latest/fhirbolt/model/r5/resources/struct.PlanDefinitionGoal.html Defines the structure of a PlanDefinitionGoal, including its fields for ID, extensions, category, description, priority, start date, addresses, documentation, and target. ```rust pub struct PlanDefinitionGoal { pub id: Option, pub extension: Vec, pub modifier_extension: Vec, pub category: Option>, pub description: Box, pub priority: Option>, pub start: Option>, pub addresses: Vec, pub documentation: Vec, pub target: Vec, } ```