-
Notifications
You must be signed in to change notification settings - Fork 251
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for x-ms-blob-content-md5 in PutBlockList (#148)
* Added support for x-ms-blob-content-md5 in PutBlockList * removed borrow in favor of Bytes * BlobBlockType now accepts BlockId * Implemented suggestions from rylev and ctaggart
- Loading branch information
1 parent
793878d
commit 0b95c40
Showing
16 changed files
with
155 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,22 @@ | ||
use std::borrow::Borrow; | ||
use crate::BlockId; | ||
|
||
// TODO: Change from Borrow<[u8]> to BlockId | ||
// Also, why Borrow? :| :| | ||
#[derive(Debug, Clone, PartialEq)] | ||
pub enum BlobBlockType<T> | ||
where | ||
T: Borrow<[u8]>, | ||
{ | ||
Committed(T), | ||
Uncommitted(T), | ||
Latest(T), | ||
pub enum BlobBlockType { | ||
Committed(BlockId), | ||
Uncommitted(BlockId), | ||
Latest(BlockId), | ||
} | ||
|
||
impl BlobBlockType { | ||
pub fn new_committed(b: impl Into<BlockId>) -> Self { | ||
BlobBlockType::Committed(b.into()) | ||
} | ||
|
||
pub fn new_uncommitted(b: impl Into<BlockId>) -> Self { | ||
BlobBlockType::Uncommitted(b.into()) | ||
} | ||
|
||
pub fn new_latest(b: impl Into<BlockId>) -> Self { | ||
BlobBlockType::Latest(b.into()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
use crate::blob::blob::BlobBlockType; | ||
use std::borrow::Borrow; | ||
|
||
#[derive(Debug, Clone, PartialEq)] | ||
pub struct BlobBlockWithSize<T> | ||
where | ||
T: Borrow<[u8]>, | ||
{ | ||
pub block_list_type: BlobBlockType<T>, | ||
pub struct BlobBlockWithSize { | ||
pub block_list_type: BlobBlockType, | ||
pub size_in_bytes: u64, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.