1use traitful::extend;
2
3use crate::result::FullResult;
4
5#[extend]
7pub trait Write: crate::Write {
8 fn u16(&mut self, int: u16) -> FullResult {
10 self.bytes(int.to_be_bytes())
11 }
12
13 fn u32(&mut self, int: u32) -> FullResult {
15 self.bytes(int.to_be_bytes())
16 }
17
18 fn u64(&mut self, int: u64) -> FullResult {
20 self.bytes(int.to_be_bytes())
21 }
22
23 fn u128(&mut self, int: u128) -> FullResult {
25 self.bytes(int.to_be_bytes())
26 }
27
28 fn i16(&mut self, int: i16) -> FullResult {
30 self.bytes(int.to_be_bytes())
31 }
32
33 fn i32(&mut self, int: i32) -> FullResult {
35 self.bytes(int.to_be_bytes())
36 }
37
38 fn i64(&mut self, int: i64) -> FullResult {
40 self.bytes(int.to_be_bytes())
41 }
42
43 fn i128(&mut self, int: i128) -> FullResult {
45 self.bytes(int.to_be_bytes())
46 }
47
48 fn f32(&mut self, float: f32) -> FullResult {
50 self.bytes(float.to_be_bytes())
51 }
52
53 fn f64(&mut self, float: f64) -> FullResult {
55 self.bytes(float.to_be_bytes())
56 }
57}