MCPcopy Create free account
hub / github.com/ElementsProject/lightning / try_from

Method try_from

plugins/lsps-plugin/src/proto/lsps2.rs:127–137  ·  view source on GitHub ↗
(s: String)

Source from the content-addressed store, hash-verified

125 type Error = PromiseError;
126
127 fn try_from(s: String) -> Result<Self, Self::Error> {
128 let len = s.len();
129 if len <= Promise::MAX_BYTES {
130 Ok(Promise(s))
131 } else {
132 Err(PromiseError::TooLong {
133 length: len,
134 max: Promise::MAX_BYTES,
135 })
136 }
137 }
138}
139
140impl TryFrom<&str> for Promise {

Callers

nothing calls this directly

Calls 1

PromiseClass · 0.85

Tested by

no test coverage detected