MCPcopy Create free account
hub / github.com/cryptape/rust-numext / defun_priv_kernel

Method defun_priv_kernel

constructor/src/fixed_uint/core/internal/kernel.rs:96–122  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

94 }
95
96 fn defun_priv_kernel(&self) {
97 let name = &self.ts.name;
98 let inner_type = &self.ts.inner_type;
99 let part = quote!(
100 /// Create a new fixed uint with a provided input.
101 #[inline]
102 const fn new(data: #inner_type) -> Self {
103 #name(data)
104 }
105 /// Get a reference of the inner data of the fixed uint.
106 #[inline]
107 pub(crate) fn inner<'a>(&'a self) -> &'a #inner_type {
108 &self.0
109 }
110 /// Get a mutable reference of the inner data of the fixed uint.
111 #[inline]
112 pub(crate) fn mut_inner<'a>(&'a mut self) -> &'a mut #inner_type {
113 &mut self.0
114 }
115 /// Get the inner data of the fixed uint.
116 #[inline]
117 pub(crate) fn into_inner(self) -> #inner_type {
118 self.0
119 }
120 );
121 self.defun(part);
122 }
123
124 fn defun_pub_kernel(&self) {
125 let unit_amount = &self.ts.unit_amount;

Callers 1

define_kernelMethod · 0.45

Calls 1

defunMethod · 0.45

Tested by

no test coverage detected