change a few comments

This commit is contained in:
Alex 2021-04-08 15:13:02 +02:00
parent c35c472dc9
commit af6774a511
No known key found for this signature in database
GPG key ID: EDABF9711E244EB1
5 changed files with 7 additions and 7 deletions

View file

@ -10,7 +10,7 @@ use crate::block::*;
#[derive(PartialEq, Clone, Debug, Serialize, Deserialize)]
pub struct BlockRef {
/// Hash of the block, used as partition key
/// Hash (blake2 sum) of the block, used as partition key
pub block: Hash,
/// Id of the Version for the object containing this block, used as sorting key

View file

@ -57,7 +57,7 @@ impl CRDT for BucketParams {
}
impl BucketParams {
/// Initializes a new instance of the Bucket struct
/// Create an empty BucketParams with no authorized keys and no website accesss
pub fn new() -> Self {
BucketParams {
authorized_keys: crdt::LWWMap::new(),
@ -67,7 +67,7 @@ impl BucketParams {
}
impl Bucket {
/// Create a new bucket
/// Initializes a new instance of the Bucket struct
pub fn new(name: String) -> Self {
Bucket {
name,

View file

@ -24,7 +24,7 @@ pub struct Key {
}
impl Key {
/// Create a new key
/// Initialize a new Key, generating a random identifier and associated secret key
pub fn new(name: String) -> Self {
let key_id = format!("GK{}", hex::encode(&rand::random::<[u8; 12]>()[..]));
let secret_key = hex::encode(&rand::random::<[u8; 32]>()[..]);

View file

@ -25,7 +25,7 @@ pub struct Object {
}
impl Object {
/// Create an object from parts
/// Initialize an Object struct from parts
pub fn new(bucket: String, key: String, versions: Vec<ObjectVersion>) -> Self {
let mut ret = Self {
bucket,
@ -102,7 +102,7 @@ impl CRDT for ObjectVersionState {
}
}
/// Data about an object version
/// Data stored in object version
#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Debug, Serialize, Deserialize)]
pub enum ObjectVersionData {
/// The object was deleted, this Version is a tombstone to mark it as such

View file

@ -72,7 +72,7 @@ impl PartialOrd for VersionBlockKey {
/// Informations about a single block
#[derive(PartialEq, Eq, Ord, PartialOrd, Clone, Copy, Debug, Serialize, Deserialize)]
pub struct VersionBlock {
/// Hash of the block
/// Blake2 sum of the block
pub hash: Hash,
/// Size of the block
pub size: u64,