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

Method try_from

cln-rpc/src/hooks.rs:58–64  ·  view source on GitHub ↗
(c: i32)

Source from the content-addressed store, hash-verified

56 impl TryFrom<i32> for PeerConnectedPeerDirection {
57 type Error = anyhow::Error;
58 fn try_from(c: i32) -> Result<PeerConnectedPeerDirection, anyhow::Error> {
59 match c {
60 0 => Ok(PeerConnectedPeerDirection::IN),
61 1 => Ok(PeerConnectedPeerDirection::OUT),
62 o => Err(anyhow::anyhow!("Unknown variant {} for enum PeerConnectedPeerDirection", o)),
63 }
64 }
65 }
66
67 impl ToString for PeerConnectedPeerDirection {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected