File tree 2 files changed +11
-0
lines changed
2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -392,6 +392,8 @@ impl GroupMutIter<'_> {
392
392
}
393
393
}
394
394
/// Inserts the given entry data at the right spot.
395
+ /// Precondition: The caller already grew the group by
396
+ /// `payload_size + size_of::<ENTRY_HEADER>()`
395
397
#[ allow( clippy:: too_many_arguments) ]
396
398
pub ( crate ) fn insert_entry (
397
399
& mut self ,
@@ -566,6 +568,9 @@ impl GroupMutItem<'_> {
566
568
Ok ( entry_size as u32 )
567
569
}
568
570
/// Resizes the given entry by SIZE_DIFF.
571
+ /// Precondition: If `size_diff > 0`, the caller must have already
572
+ /// expanded the group `size_diff`. If `size_diff < 0`, the caller
573
+ /// must call `resize_entry_by` before resizing the group.
569
574
pub ( crate ) fn resize_entry_by (
570
575
& mut self ,
571
576
entry_id : EntryId ,
@@ -634,6 +639,8 @@ impl GroupMutItem<'_> {
634
639
}
635
640
}
636
641
/// Inserts the given token.
642
+ /// Precondition: Caller already increased the group size by
643
+ /// `size_of::<TOKEN_ENTRY>()`.
637
644
pub ( crate ) fn insert_token (
638
645
& mut self ,
639
646
entry_id : EntryId ,
Original file line number Diff line number Diff line change @@ -203,6 +203,8 @@ impl<'a> TokensEntryIter<&'a mut [u8]> {
203
203
}
204
204
205
205
/// Inserts the given entry data at the right spot.
206
+ /// Precondition: Caller must have already increased the group size
207
+ /// by `size_of::<TOKEN_ENTRY>()`.
206
208
pub ( crate ) fn insert_token (
207
209
& mut self ,
208
210
token_id : u32 ,
@@ -602,6 +604,8 @@ impl TokensEntryBodyItem<&mut [u8]> {
602
604
( self . iter_mut ( ) . ok ( ) ?) . find ( |entry| entry. id ( ) == token_id)
603
605
}
604
606
607
+ /// Precondition: Caller already increased the group size by
608
+ /// `size_of::<TOKEN_ENTRY>()`.
605
609
pub ( crate ) fn insert_token (
606
610
& mut self ,
607
611
token_id : u32 ,
You can’t perform that action at this time.
0 commit comments