pub struct DataSnapshot { /* private fields */ }Expand description
Represents a data snapshot returned to listeners, analogous to the JS
DataSnapshot type.
Implementations§
Source§impl DataSnapshot
impl DataSnapshot
pub fn reference(&self) -> &DatabaseReference
pub fn value(&self) -> &Value
pub fn exists(&self) -> bool
pub fn key(&self) -> Option<&str>
pub fn into_value(self) -> Value
Sourcepub fn child(&self, relative_path: &str) -> DatabaseResult<DataSnapshot>
pub fn child(&self, relative_path: &str) -> DatabaseResult<DataSnapshot>
Returns a snapshot for the provided relative path, mirroring
DataSnapshot.child(path) in Reference_impl.ts.
Sourcepub fn has_child(&self, relative_path: &str) -> DatabaseResult<bool>
pub fn has_child(&self, relative_path: &str) -> DatabaseResult<bool>
Returns whether data exists at the provided child path, mirroring the JS
DataSnapshot.hasChild() helper.
Sourcepub fn has_children(&self) -> bool
pub fn has_children(&self) -> bool
Returns whether the snapshot has any direct child properties, mirroring
DataSnapshot.hasChildren().
Trait Implementations§
Source§impl Clone for DataSnapshot
impl Clone for DataSnapshot
Source§fn clone(&self) -> DataSnapshot
fn clone(&self) -> DataSnapshot
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 DataSnapshot
impl !RefUnwindSafe for DataSnapshot
impl Send for DataSnapshot
impl Sync for DataSnapshot
impl Unpin for DataSnapshot
impl !UnwindSafe for DataSnapshot
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