pub struct OwnedDictionary { /* private fields */ }Available on crate feature
alloc only.Expand description
An owned Dictionary.
§Examples
use parse_net::sfv::{self, owned::OwnedDictionary};
let owned: OwnedDictionary = {
let input = b"a=1, b".to_vec();
sfv::parse_dictionary(&input)?.to_owned()
};
assert_eq!(owned.as_view().len(), 2);Implementations§
Source§impl OwnedDictionary
impl OwnedDictionary
Sourcepub fn as_view(&self) -> Dictionary<'_>
pub fn as_view(&self) -> Dictionary<'_>
The view over the owned bytes.
§Examples
use parse_net::sfv::{self, BareItem, Member};
let owned = sfv::parse_dictionary(b"q=0.5")?.to_owned();
assert!(matches!(owned.as_view().get("q"), Some(Member::Item(i)) if i.bare == BareItem::Decimal(sfv::Decimal::from_thousandths(500)?)));Trait Implementations§
Source§impl Clone for OwnedDictionary
impl Clone for OwnedDictionary
Source§impl Debug for OwnedDictionary
impl Debug for OwnedDictionary
impl Eq for OwnedDictionary
Source§impl Hash for OwnedDictionary
impl Hash for OwnedDictionary
Source§impl PartialEq for OwnedDictionary
impl PartialEq for OwnedDictionary
impl StructuralPartialEq for OwnedDictionary
Auto Trait Implementations§
impl Freeze for OwnedDictionary
impl RefUnwindSafe for OwnedDictionary
impl Send for OwnedDictionary
impl Sync for OwnedDictionary
impl Unpin for OwnedDictionary
impl UnsafeUnpin for OwnedDictionary
impl UnwindSafe for OwnedDictionary
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