Lines Matching refs:new
80 pub fn new(file: F) -> Self { in new() method
81 Self { file, merkle_tree: Arc::new(RwLock::new(MerkleLeaves::new())) } in new()
92 merkle_tree.calculate_fsverity_digest().map_err(|e| io::Error::new(io::ErrorKind::Other, e)) in calculate_fsverity_digest()
117 return Err(io::Error::new(io::ErrorKind::InvalidData, "Inconsistent hash")); in read_backing_chunk_verified()
145 return Err(io::Error::new(io::ErrorKind::InvalidData, "Inconsistent hash")); in new_hash_for_incomplete_write()
149 let mut ctx = Sha256::new(); in new_hash_for_incomplete_write()
200 ChunkedSizeIter::new(buf.len(), offset, CHUNK_SIZE as usize) in write_at()
269 let mut ctx = Sha256::new(); in resize()
308 pub fn new() -> InMemoryEditor { in new() method
309 InMemoryEditor { data: RefCell::new(Vec::new()), fail_read: false } in new()
316 offset.try_into().map_err(|e| io::Error::new(io::ErrorKind::Other, e))?; in write_at()
327 size.try_into().map_err(|e| io::Error::new(io::ErrorKind::Other, e))?; in resize()
336 return Err(io::Error::new(io::ErrorKind::Other, "test!")); in read_chunk()
344 io::Error::new( in read_chunk()
356 let writer = InMemoryEditor::new(); in test_writer()
373 let file = VerifiedFileEditor::new(InMemoryEditor::new()); in test_verified_writer_no_write()
385 let file = VerifiedFileEditor::new(InMemoryEditor::new()); in test_verified_writer_from_zero()
394 let file = VerifiedFileEditor::new(InMemoryEditor::new()); in test_verified_writer_from_zero()
403 let file = VerifiedFileEditor::new(InMemoryEditor::new()); in test_verified_writer_from_zero()
416 let file = VerifiedFileEditor::new(InMemoryEditor::new()); in test_verified_writer_unaligned()
425 let file = VerifiedFileEditor::new(InMemoryEditor::new()); in test_verified_writer_unaligned()
438 let file = VerifiedFileEditor::new(InMemoryEditor::new()); in test_verified_writer_with_hole()
447 let file = VerifiedFileEditor::new(InMemoryEditor::new()); in test_verified_writer_with_hole()
456 let file = VerifiedFileEditor::new(InMemoryEditor::new()); in test_verified_writer_with_hole()
468 let file = VerifiedFileEditor::new(InMemoryEditor::new()); in test_verified_writer_various_writes()
508 let file = VerifiedFileEditor::new(InMemoryEditor::new()); in test_verified_writer_inconsistent_read()
538 let mut writer = InMemoryEditor::new(); in test_verified_writer_failed_read_back()
540 let file = VerifiedFileEditor::new(writer); in test_verified_writer_failed_read_back()
550 let file = VerifiedFileEditor::new(InMemoryEditor::new()); in test_resize_to_same_size()
566 let file = VerifiedFileEditor::new(InMemoryEditor::new()); in test_resize_to_grow()
583 let file = VerifiedFileEditor::new(InMemoryEditor::new()); in test_resize_to_shrink()
600 let mut writer = InMemoryEditor::new(); in test_resize_to_shrink_with_read_failure()
602 let file = VerifiedFileEditor::new(writer); in test_resize_to_shrink_with_read_failure()
612 let mut writer = InMemoryEditor::new(); in test_resize_to_shirink_to_chunk_boundary()
614 let file = VerifiedFileEditor::new(writer); in test_resize_to_shirink_to_chunk_boundary()