1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright (C) 2019 Boyu Yang
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

pub mod kernel;

use balloons::{Balloon, BalloonBuilder};

/// The builder of `Blake2b256Balloon`.
#[derive(Default)]
pub struct Blake2b256BalloonBuilder(BalloonBuilder);

/// The builder of `Blake2b256Balloon`.
pub type Blake2b256Balloon = Balloon<kernel::U256, kernel::H256, kernel::Blake2b256>;

impl ::std::ops::Deref for Blake2b256BalloonBuilder {
    type Target = BalloonBuilder;
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}

impl ::std::ops::DerefMut for Blake2b256BalloonBuilder {
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.0
    }
}

impl AsMut<BalloonBuilder> for Blake2b256BalloonBuilder {
    fn as_mut(&mut self) -> &mut BalloonBuilder {
        &mut self.0
    }
}

impl Blake2b256BalloonBuilder {
    pub fn new() -> Self {
        Default::default()
    }

    pub fn build(&self) -> Blake2b256Balloon {
        self.0.build()
    }
}