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

Method try_from

cln-rpc/src/model.rs:474–483  ·  view source on GitHub ↗
(c: i32)

Source from the content-addressed store, hash-verified

472 impl TryFrom<i32> for ListpeersLevel {
473 type Error = anyhow::Error;
474 fn try_from(c: i32) -> Result<ListpeersLevel, anyhow::Error> {
475 match c {
476 0 => Ok(ListpeersLevel::IO),
477 1 => Ok(ListpeersLevel::DEBUG),
478 2 => Ok(ListpeersLevel::INFO),
479 3 => Ok(ListpeersLevel::UNUSUAL),
480 4 => Ok(ListpeersLevel::TRACE),
481 o => Err(anyhow::anyhow!("Unknown variant {} for enum ListpeersLevel", o)),
482 }
483 }
484 }
485
486 impl ToString for ListpeersLevel {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected