pub struct StagedGroup<'a> { /* private fields */ }Expand description
A group that exists only as a staged edit, handed to
Group::create_group_with’s closure so attributes can be set on a group
that is not yet committed (and so has no resolvable header to hang a
Group handle off).
Every method stages; nothing is written until File::commit, and a staged
object is not resolvable by name until then.
The closure holding this records into a buffer rather than into the file’s
writable session, so nothing is locked while it runs. The recorded operations
are applied together when it returns, which is also why a staged object is not
resolvable until File::commit.
Implementations§
Source§impl StagedGroup<'_>
impl StagedGroup<'_>
Sourcepub fn set_attr(&mut self, name: &str, value: AttrValue) -> &mut Self
pub fn set_attr(&mut self, name: &str, value: AttrValue) -> &mut Self
Stage an attribute on this group, applied with its creation on
File::commit.
Sourcepub fn create_group(&mut self, name: &str) -> &mut Self
pub fn create_group(&mut self, name: &str) -> &mut Self
Stage an empty subgroup of this group.
To configure it in the same commit, use
create_group_with.
Sourcepub fn create_group_with(
&mut self,
name: &str,
build: impl FnOnce(&mut StagedGroup<'_>),
) -> &mut Self
pub fn create_group_with( &mut self, name: &str, build: impl FnOnce(&mut StagedGroup<'_>), ) -> &mut Self
Stage a subgroup of this group, configured through build.
Sourcepub fn create_dataset(
&mut self,
name: &str,
build: impl FnOnce(&mut DatasetBuilder),
) -> &mut Self
pub fn create_dataset( &mut self, name: &str, build: impl FnOnce(&mut DatasetBuilder), ) -> &mut Self
Stage a dataset in this group, configured through build.
Auto Trait Implementations§
impl<'a> !UnwindSafe for StagedGroup<'a>
impl<'a> Freeze for StagedGroup<'a>
impl<'a> RefUnwindSafe for StagedGroup<'a>
impl<'a> Send for StagedGroup<'a>
impl<'a> Sync for StagedGroup<'a>
impl<'a> Unpin for StagedGroup<'a>
impl<'a> UnsafeUnpin for StagedGroup<'a>
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> 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