pub struct Collection { /* private fields */ }Expand description
Collection optimized for singleton case (90% of FHIRPath collections are single-element)
For small collections (≤4 items), uses SmallVec directly. For large collections (>4 items), wraps the vector in Arc to make cloning O(1).
Implementations§
Source§impl Collection
impl Collection
pub fn empty() -> Self
pub fn singleton(value: Value) -> Self
pub fn with_capacity(capacity: usize) -> Self
pub fn push(&mut self, value: Value)
pub fn iter(&self) -> impl Iterator<Item = &Value>
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
pub fn as_boolean(&self) -> Result<bool>
pub fn as_string(&self) -> Result<Arc<str>>
pub fn as_integer(&self) -> Result<i64>
Trait Implementations§
Source§impl Clone for Collection
impl Clone for Collection
Source§fn clone(&self) -> Collection
fn clone(&self) -> Collection
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Collection
impl RefUnwindSafe for Collection
impl Send for Collection
impl Sync for Collection
impl Unpin for Collection
impl UnwindSafe for Collection
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