pub struct InMemDicomObject<D = StandardDataDictionary> { /* private fields */ }
Expand description
A DICOM object that is fully contained in memory.
See the module-level documentation for more details.
Implementations§
Source§impl InMemDicomObject<StandardDataDictionary>
impl InMemDicomObject<StandardDataDictionary>
Sourcepub fn from_element_source<I>(iter: I) -> Result<Self, AccessError>
pub fn from_element_source<I>(iter: I) -> Result<Self, AccessError>
Construct a DICOM object from a fallible source of structured elements.
Sourcepub fn from_element_iter<I>(iter: I) -> Self
pub fn from_element_iter<I>(iter: I) -> Self
Construct a DICOM object from a non-fallible source of structured elements.
Sourcepub fn command_from_element_iter<I>(iter: I) -> Self
pub fn command_from_element_iter<I>(iter: I) -> Self
Construct a DICOM object representing a command set, from a non-fallible iterator of structured elements.
This method will automatically insert a Command Group Length (0000,0000) element based on the command elements found in the sequence.
Sourcepub fn read_dataset<S>(decoder: S) -> Result<Self, ReadError>where
S: StatefulDecode,
pub fn read_dataset<S>(decoder: S) -> Result<Self, ReadError>where
S: StatefulDecode,
Read an object from a source using the given decoder.
Note: read_dataset_with_ts
and read_dataset_with_ts_cs
may be easier to use.
Sourcepub fn read_dataset_with_ts_cs<S>(
from: S,
ts: &TransferSyntax,
cs: SpecificCharacterSet,
) -> Result<Self, ReadError>where
S: Read,
pub fn read_dataset_with_ts_cs<S>(
from: S,
ts: &TransferSyntax,
cs: SpecificCharacterSet,
) -> Result<Self, ReadError>where
S: Read,
Read an object from a source, using the given transfer syntax and default character set.
If the attribute Specific Character Set is found in the encoded data, this will override the given character set.
Sourcepub fn read_dataset_with_ts<S>(
from: S,
ts: &TransferSyntax,
) -> Result<Self, ReadError>where
S: Read,
pub fn read_dataset_with_ts<S>(
from: S,
ts: &TransferSyntax,
) -> Result<Self, ReadError>where
S: Read,
Read an object from a source, using the given transfer syntax.
The default character set is assumed until Specific Character Set is found in the encoded data, after which the text decoder will be overridden accordingly.
Source§impl<D> InMemDicomObject<D>where
D: DataDictionary + Clone,
impl<D> InMemDicomObject<D>where
D: DataDictionary + Clone,
Sourcepub fn new_empty_with_dict(dict: D) -> Self
pub fn new_empty_with_dict(dict: D) -> Self
Create a new empty object, using the given dictionary for name lookup.
Sourcepub fn from_element_source_with_dict<I>(
iter: I,
dict: D,
) -> Result<Self, AccessError>
pub fn from_element_source_with_dict<I>( iter: I, dict: D, ) -> Result<Self, AccessError>
Construct a DICOM object from an iterator of structured elements.
Sourcepub fn from_iter_with_dict<I>(iter: I, dict: D) -> Selfwhere
I: IntoIterator<Item = InMemElement<D>>,
pub fn from_iter_with_dict<I>(iter: I, dict: D) -> Selfwhere
I: IntoIterator<Item = InMemElement<D>>,
Construct a DICOM object from a non-fallible iterator of structured elements.
Sourcepub fn command_from_iter_with_dict<I>(iter: I, dict: D) -> Selfwhere
I: IntoIterator<Item = InMemElement<D>>,
pub fn command_from_iter_with_dict<I>(iter: I, dict: D) -> Selfwhere
I: IntoIterator<Item = InMemElement<D>>,
Construct a DICOM object representing a command set, from a non-fallible iterator of structured elements.
This method will automatically insert a Command Group Length (0000,0000) element based on the command elements found in the sequence.
Sourcepub fn read_dataset_with_dict<S>(decoder: S, dict: D) -> Result<Self, ReadError>where
S: StatefulDecode,
D: DataDictionary,
pub fn read_dataset_with_dict<S>(decoder: S, dict: D) -> Result<Self, ReadError>where
S: StatefulDecode,
D: DataDictionary,
Read an object from a source, using the given decoder and the given dictionary for name lookup.
Sourcepub fn read_dataset_with_dict_ts<S>(
from: S,
dict: D,
ts: &TransferSyntax,
) -> Result<Self, ReadError>where
S: Read,
D: DataDictionary,
pub fn read_dataset_with_dict_ts<S>(
from: S,
dict: D,
ts: &TransferSyntax,
) -> Result<Self, ReadError>where
S: Read,
D: DataDictionary,
Read an object from a source, using the given data dictionary and transfer syntax.
Sourcepub fn read_dataset_with_dict_ts_cs<S>(
from: S,
dict: D,
ts: &TransferSyntax,
cs: SpecificCharacterSet,
) -> Result<Self, ReadError>where
S: Read,
D: DataDictionary,
pub fn read_dataset_with_dict_ts_cs<S>(
from: S,
dict: D,
ts: &TransferSyntax,
cs: SpecificCharacterSet,
) -> Result<Self, ReadError>where
S: Read,
D: DataDictionary,
Read an object from a source, using the given data dictionary, transfer syntax, and the given character set to assume by default.
If the attribute Specific Character Set is found in the encoded data, this will override the given character set.
Sourcepub fn element(&self, tag: Tag) -> Result<&InMemElement<D>, AccessError>
pub fn element(&self, tag: Tag) -> Result<&InMemElement<D>, AccessError>
Retrieve a particular DICOM element by its tag.
An error is returned if the element does not exist.
For an alternative to this behavior,
see element_opt
.
Sourcepub fn element_by_name(
&self,
name: &str,
) -> Result<&InMemElement<D>, AccessByNameError>
pub fn element_by_name( &self, name: &str, ) -> Result<&InMemElement<D>, AccessByNameError>
Retrieve a particular DICOM element by its name.
This method translates the given attribute name into its tag
before retrieving the element.
If the attribute is known in advance,
using element
with a tag constant is preferred.
An error is returned if the element does not exist.
For an alternative to this behavior,
see element_by_name_opt
.
Sourcepub fn element_opt(
&self,
tag: Tag,
) -> Result<Option<&InMemElement<D>>, AccessError>
pub fn element_opt( &self, tag: Tag, ) -> Result<Option<&InMemElement<D>>, AccessError>
Retrieve a particular DICOM element that might not exist by its tag.
If the element does not exist,
None
is returned.
Sourcepub fn get(&self, tag: Tag) -> Option<&InMemElement<D>>
pub fn get(&self, tag: Tag) -> Option<&InMemElement<D>>
Get a particular DICOM attribute from this object by tag.
If the element does not exist,
None
is returned.
Sourcepub fn element_by_name_opt(
&self,
name: &str,
) -> Result<Option<&InMemElement<D>>, AccessByNameError>
pub fn element_by_name_opt( &self, name: &str, ) -> Result<Option<&InMemElement<D>>, AccessByNameError>
Retrieve a particular DICOM element that might not exist by its name.
If the element does not exist,
None
is returned.
This method translates the given attribute name into its tag
before retrieving the element.
If the attribute is known in advance,
using element_opt
with a tag constant is preferred.
Sourcepub fn private_element(
&self,
group: GroupNumber,
creator: &str,
element: u8,
) -> Result<&InMemElement<D>, PrivateElementError>
pub fn private_element( &self, group: GroupNumber, creator: &str, element: u8, ) -> Result<&InMemElement<D>, PrivateElementError>
Get a private element from the dataset using the group number, creator and element number.
An error is raised when the group number is not odd, the private creator is not found in the group, or the private element is not found.
For more info, see the DICOM standard section on private elements.
§Example
let mut ds = InMemDicomObject::from_element_iter([
DataElement::new(
Tag(0x0009, 0x0010),
VR::LO,
PrimitiveValue::from("CREATOR 1"),
),
DataElement::new(Tag(0x0009, 0x01001), VR::DS, "1.0"),
]);
assert_eq!(
ds.private_element(0x0009, "CREATOR 1", 0x01)?
.value()
.to_str()?,
"1.0"
);
Sourcepub fn put(&mut self, elt: InMemElement<D>) -> Option<InMemElement<D>>
pub fn put(&mut self, elt: InMemElement<D>) -> Option<InMemElement<D>>
Insert a data element to the object, replacing (and returning) any previous element of the same attribute. This might invalidate all sequence and item lengths if the charset of the element changes.
Sourcepub fn put_element(&mut self, elt: InMemElement<D>) -> Option<InMemElement<D>>
pub fn put_element(&mut self, elt: InMemElement<D>) -> Option<InMemElement<D>>
Insert a data element to the object, replacing (and returning) any previous element of the same attribute. This might invalidate all sequence and item lengths if the charset of the element changes.
Sourcepub fn put_private_element(
&mut self,
group: GroupNumber,
creator: &str,
element: u8,
vr: VR,
value: PrimitiveValue,
) -> Result<Option<InMemElement<D>>, PrivateElementError>
pub fn put_private_element( &mut self, group: GroupNumber, creator: &str, element: u8, vr: VR, value: PrimitiveValue, ) -> Result<Option<InMemElement<D>>, PrivateElementError>
Insert a private element into the dataset, replacing (and returning) any previous element of the same attribute.
This function will find the next available private element block in the given group. If the creator already exists, the element will be added to the block already reserved for that creator. If it does not exist, then a new block will be reserved for the creator in the specified group. An error is returned if there is no space left in the group.
For more info, see the DICOM standard section on private elements.
§Example
let mut ds = InMemDicomObject::new_empty();
ds.put_private_element(
0x0009,
"CREATOR 1",
0x02,
VR::DS,
PrimitiveValue::from("1.0"),
)?;
assert_eq!(
ds.private_element(0x0009, "CREATOR 1", 0x02)?
.value()
.to_str()?,
"1.0"
);
assert_eq!(
ds.private_element(0x0009, "CREATOR 1", 0x02)?
.header()
.tag(),
Tag(0x0009, 0x0102)
);
Sourcepub fn put_str(
&mut self,
tag: Tag,
vr: VR,
string: impl Into<String>,
) -> Option<InMemElement<D>>
pub fn put_str( &mut self, tag: Tag, vr: VR, string: impl Into<String>, ) -> Option<InMemElement<D>>
Insert a new element with a string value to the object, replacing (and returning) any previous element of the same attribute.
Sourcepub fn remove_element(&mut self, tag: Tag) -> bool
pub fn remove_element(&mut self, tag: Tag) -> bool
Remove a DICOM element by its tag, reporting whether it was present.
Sourcepub fn remove_element_by_name(
&mut self,
name: &str,
) -> Result<bool, AccessByNameError>
pub fn remove_element_by_name( &mut self, name: &str, ) -> Result<bool, AccessByNameError>
Remove a DICOM element by its keyword, reporting whether it was present.
Sourcepub fn take_element(&mut self, tag: Tag) -> Result<InMemElement<D>, AccessError>
pub fn take_element(&mut self, tag: Tag) -> Result<InMemElement<D>, AccessError>
Remove and return a particular DICOM element by its tag.
Sourcepub fn take(&mut self, tag: Tag) -> Option<InMemElement<D>>
pub fn take(&mut self, tag: Tag) -> Option<InMemElement<D>>
Remove and return a particular DICOM element by its tag,
if it is present,
returns None
otherwise.
Sourcepub fn take_element_by_name(
&mut self,
name: &str,
) -> Result<InMemElement<D>, AccessByNameError>
pub fn take_element_by_name( &mut self, name: &str, ) -> Result<InMemElement<D>, AccessByNameError>
Remove and return a particular DICOM element by its name.
Sourcepub fn retain(&mut self, f: impl FnMut(&InMemElement<D>) -> bool)
pub fn retain(&mut self, f: impl FnMut(&InMemElement<D>) -> bool)
Modify the object by retaining only the DICOM data elements specified by the predicate.
The elements are visited in ascending tag order,
and those for which f(&element)
returns false
are removed.
Sourcepub fn update_value(
&mut self,
tag: Tag,
f: impl FnMut(&mut Value<InMemDicomObject<D>, InMemFragment>),
) -> bool
pub fn update_value( &mut self, tag: Tag, f: impl FnMut(&mut Value<InMemDicomObject<D>, InMemFragment>), ) -> bool
Obtain a temporary mutable reference to a DICOM value by tag, so that mutations can be applied within.
If found, this method resets all related lengths recorded
and returns true
.
Returns false
otherwise.
§Example
let mut obj = InMemDicomObject::from_element_iter([
DataElement::new(tags::LOSSY_IMAGE_COMPRESSION_RATIO, VR::DS, dicom_value!(Strs, ["25"])),
]);
// update lossy image compression ratio
obj.update_value(tags::LOSSY_IMAGE_COMPRESSION_RATIO, |e| {
e.primitive_mut().unwrap().extend_str(["2.56"]);
});
assert_eq!(
obj.get(tags::LOSSY_IMAGE_COMPRESSION_RATIO).unwrap().value().to_str().unwrap(),
"25\\2.56"
);
Sourcepub fn update_value_at(
&mut self,
selector: impl Into<AttributeSelector>,
f: impl FnMut(&mut Value<InMemDicomObject<D>, InMemFragment>),
) -> Result<(), AtAccessError>
pub fn update_value_at( &mut self, selector: impl Into<AttributeSelector>, f: impl FnMut(&mut Value<InMemDicomObject<D>, InMemFragment>), ) -> Result<(), AtAccessError>
Obtain a temporary mutable reference to a DICOM value by AttributeSelector, so that mutations can be applied within.
If found, this method resets all related lengths recorded
and returns true
.
Returns false
otherwise.
See the documentation of AttributeSelector
for more information
on how to write attribute selectors.
Note: Consider using apply
when possible.
§Example
let mut dcm = InMemDicomObject::from_element_iter([
DataElement::new(
tags::OTHER_PATIENT_I_DS_SEQUENCE,
VR::SQ,
DataSetSequence::from(vec![InMemDicomObject::from_element_iter([
DataElement::new(
tags::PATIENT_ID,
VR::LO,
dicom_value!(Str, "1234")
)])
])
),
]);
let selector = (
tags::OTHER_PATIENT_I_DS_SEQUENCE,
0,
tags::PATIENT_ID
);
// update referenced SOP instance UID for deidentification potentially
dcm.update_value_at(*&selector, |e| {
let mut v = e.primitive_mut().unwrap();
*v = dicom_value!(Str, "abcd");
});
assert_eq!(
dcm.entry_at(*&selector).unwrap().value().to_str().unwrap(),
"abcd"
);
Sourcepub fn value_at(
&self,
selector: impl Into<AttributeSelector>,
) -> Result<&Value<InMemDicomObject<D>, InMemFragment>, AtAccessError>
pub fn value_at( &self, selector: impl Into<AttributeSelector>, ) -> Result<&Value<InMemDicomObject<D>, InMemFragment>, AtAccessError>
Obtain the DICOM value by finding the element that matches the given selector.
Returns an error if the respective element or any of its parents cannot be found.
See the documentation of AttributeSelector
for more information
on how to write attribute selectors.
§Example
let referenced_sop_instance_iod = obj.value_at(
(
tags::SHARED_FUNCTIONAL_GROUPS_SEQUENCE,
tags::REFERENCED_IMAGE_SEQUENCE,
tags::REFERENCED_SOP_INSTANCE_UID,
))?
.to_str()?;
Sourcepub fn convert_to_utf8(&mut self)
pub fn convert_to_utf8(&mut self)
Change the ‘specific_character_set’ tag to ISO_IR 192, marking the dataset as UTF-8
Sourcepub fn entry_at(
&self,
selector: impl Into<AttributeSelector>,
) -> Result<&InMemElement<D>, AtAccessError>
pub fn entry_at( &self, selector: impl Into<AttributeSelector>, ) -> Result<&InMemElement<D>, AtAccessError>
Get a DataElement by AttributeSelector
If the element or other intermediate elements do not exist, the method will return an error.
See the documentation of AttributeSelector
for more information
on how to write attribute selectors.
If you only need the value, use value_at
.
Sourcepub fn write_dataset<W, E>(&self, to: W, encoder: E) -> Result<(), WriteError>
pub fn write_dataset<W, E>(&self, to: W, encoder: E) -> Result<(), WriteError>
Write this object’s data set into the given writer, with the given encoder specifications, without preamble, magic code, nor file meta group.
The text encoding to use will be the default character set until Specific Character Set is found in the data set, in which then that character set will be used.
Note: write_dataset_with_ts
and write_dataset_with_ts_cs
may be easier to use.
Sourcepub fn write_dataset_with_ts_cs<W>(
&self,
to: W,
ts: &TransferSyntax,
cs: SpecificCharacterSet,
) -> Result<(), WriteError>where
W: Write,
pub fn write_dataset_with_ts_cs<W>(
&self,
to: W,
ts: &TransferSyntax,
cs: SpecificCharacterSet,
) -> Result<(), WriteError>where
W: Write,
Write this object’s data set into the given printer, with the specified transfer syntax and character set, without preamble, magic code, nor file meta group.
If the attribute Specific Character Set is found in the data set,
the last parameter is overridden accordingly.
See also write_dataset_with_ts
.
Sourcepub fn write_dataset_with_ts<W>(
&self,
to: W,
ts: &TransferSyntax,
) -> Result<(), WriteError>where
W: Write,
pub fn write_dataset_with_ts<W>(
&self,
to: W,
ts: &TransferSyntax,
) -> Result<(), WriteError>where
W: Write,
Write this object’s data set into the given writer, with the specified transfer syntax, without preamble, magic code, nor file meta group.
The default character set is assumed until the Specific Character Set is found in the data set, after which the text encoder is overridden accordingly.
Sourcepub fn with_exact_meta(self, meta: FileMetaTable) -> FileDicomObject<Self>
pub fn with_exact_meta(self, meta: FileMetaTable) -> FileDicomObject<Self>
Encapsulate this object to contain a file meta group as described exactly by the given table.
Note: this method will not adjust the file meta group to be semantically valid for the object. Namely, the Media Storage SOP Instance UID and Media Storage SOP Class UID are not updated based on the receiving data set.
Sourcepub fn with_meta(
self,
meta: FileMetaTableBuilder,
) -> Result<FileDicomObject<Self>, WithMetaError>
pub fn with_meta( self, meta: FileMetaTableBuilder, ) -> Result<FileDicomObject<Self>, WithMetaError>
Encapsulate this object to contain a file meta group, created through the given file meta table builder.
A complete file meta group should provide the Transfer Syntax UID, the Media Storage SOP Instance UID, and the Media Storage SOP Class UID. The last two will be filled with the values of SOP Instance UID and SOP Class UID if they are present in this object.
§Example
use dicom_object::{InMemDicomObject, meta::FileMetaTableBuilder};
let obj = InMemDicomObject::from_element_iter([
DataElement::new(tags::SOP_CLASS_UID, VR::UI, uids::COMPUTED_RADIOGRAPHY_IMAGE_STORAGE),
DataElement::new(tags::SOP_INSTANCE_UID, VR::UI, "2.25.60156688944589400766024286894543900794"),
// ...
]);
let obj = obj.with_meta(FileMetaTableBuilder::new()
.transfer_syntax(uids::EXPLICIT_VR_LITTLE_ENDIAN))?;
// can now save everything to a file
let meta = obj.write_to_file("out.dcm")?;
Sourcepub fn iter(&self) -> impl Iterator<Item = &InMemElement<D>> + '_
pub fn iter(&self) -> impl Iterator<Item = &InMemElement<D>> + '_
Obtain an iterator over the elements of this object.
Obtain an iterator over the tags of the object’s elements.
Trait Implementations§
Source§impl<D> ApplyOp for InMemDicomObject<D>where
D: DataDictionary + Clone,
impl<D> ApplyOp for InMemDicomObject<D>where
D: DataDictionary + Clone,
Source§type Err = ApplyError
type Err = ApplyError
Source§fn apply(&mut self, op: AttributeOp) -> ApplyResult
fn apply(&mut self, op: AttributeOp) -> ApplyResult
Source§impl<D: Clone> Clone for InMemDicomObject<D>
impl<D: Clone> Clone for InMemDicomObject<D>
Source§fn clone(&self) -> InMemDicomObject<D>
fn clone(&self) -> InMemDicomObject<D>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<D: Debug> Debug for InMemDicomObject<D>
impl<D: Debug> Debug for InMemDicomObject<D>
Source§impl<'s, D> DicomObject for &'s InMemDicomObject<D>where
D: DataDictionary + Clone + 's,
impl<'s, D> DicomObject for &'s InMemDicomObject<D>where
D: DataDictionary + Clone + 's,
type Element = &'s DataElement<InMemDicomObject<D>>
Source§fn element(&self, tag: Tag) -> Result<Self::Element, AccessError>
fn element(&self, tag: Tag) -> Result<Self::Element, AccessError>
Source§fn element_by_name(
&self,
name: &str,
) -> Result<Self::Element, AccessByNameError>
fn element_by_name( &self, name: &str, ) -> Result<Self::Element, AccessByNameError>
Source§impl<D> Extend<DataElement<InMemDicomObject<D>>> for InMemDicomObject<D>
impl<D> Extend<DataElement<InMemDicomObject<D>>> for InMemDicomObject<D>
Source§fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = InMemElement<D>>,
fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = InMemElement<D>>,
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Source§impl<D> HasLength for InMemDicomObject<D>
impl<D> HasLength for InMemDicomObject<D>
Source§impl<'a, D> IntoIterator for &'a InMemDicomObject<D>
impl<'a, D> IntoIterator for &'a InMemDicomObject<D>
Source§type Item = &'a DataElement<InMemDicomObject<D>>
type Item = &'a DataElement<InMemDicomObject<D>>
Source§type IntoIter = Values<'a, Tag, DataElement<InMemDicomObject<D>>>
type IntoIter = Values<'a, Tag, DataElement<InMemDicomObject<D>>>
Source§impl<D> IntoIterator for InMemDicomObject<D>
impl<D> IntoIterator for InMemDicomObject<D>
Source§impl<'a, D> IntoTokens for &'a InMemDicomObject<D>where
D: Clone,
impl<'a, D> IntoTokens for &'a InMemDicomObject<D>where
D: Clone,
Source§type Iter = InMemObjectTokens<Cloned<<&'a InMemDicomObject<D> as IntoIterator>::IntoIter>>
type Iter = InMemObjectTokens<Cloned<<&'a InMemDicomObject<D> as IntoIterator>::IntoIter>>
fn into_tokens(self) -> Self::Iter
fn into_tokens_with_options(self, options: IntoTokensOptions) -> Self::Iter
Source§impl<D> IntoTokens for InMemDicomObject<D>
impl<D> IntoTokens for InMemDicomObject<D>
Source§type Iter = InMemObjectTokens<<InMemDicomObject<D> as IntoIterator>::IntoIter>
type Iter = InMemObjectTokens<<InMemDicomObject<D> as IntoIterator>::IntoIter>
fn into_tokens(self) -> Self::Iter
fn into_tokens_with_options(self, options: IntoTokensOptions) -> Self::Iter
Source§impl<D> PartialEq for InMemDicomObject<D>
impl<D> PartialEq for InMemDicomObject<D>
Auto Trait Implementations§
impl<D> Freeze for InMemDicomObject<D>where
D: Freeze,
impl<D> RefUnwindSafe for InMemDicomObject<D>where
D: RefUnwindSafe,
impl<D> Send for InMemDicomObject<D>where
D: Send,
impl<D> Sync for InMemDicomObject<D>where
D: Sync,
impl<D> Unpin for InMemDicomObject<D>where
D: Unpin,
impl<D> UnwindSafe for InMemDicomObject<D>where
D: UnwindSafe + RefUnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more