MCPcopy Create free account
hub / github.com/solana-program/system / from_i64

Method from_i64

interface/src/error.rs:35–57  ·  view source on GitHub ↗
(n: i64)

Source from the content-addressed store, hash-verified

33impl FromPrimitive for SystemError {
34 #[inline]
35 fn from_i64(n: i64) -> Option<Self> {
36 if n == Self::AccountAlreadyInUse as i64 {
37 Some(Self::AccountAlreadyInUse)
38 } else if n == Self::ResultWithNegativeLamports as i64 {
39 Some(Self::ResultWithNegativeLamports)
40 } else if n == Self::InvalidProgramId as i64 {
41 Some(Self::InvalidProgramId)
42 } else if n == Self::InvalidAccountDataLength as i64 {
43 Some(Self::InvalidAccountDataLength)
44 } else if n == Self::MaxSeedLengthExceeded as i64 {
45 Some(Self::MaxSeedLengthExceeded)
46 } else if n == Self::AddressWithSeedMismatch as i64 {
47 Some(Self::AddressWithSeedMismatch)
48 } else if n == Self::NonceNoRecentBlockhashes as i64 {
49 Some(Self::NonceNoRecentBlockhashes)
50 } else if n == Self::NonceBlockhashNotExpired as i64 {
51 Some(Self::NonceBlockhashNotExpired)
52 } else if n == Self::NonceUnexpectedBlockhashValue as i64 {
53 Some(Self::NonceUnexpectedBlockhashValue)
54 } else {
55 None
56 }
57 }
58 #[inline]
59 fn from_u64(n: u64) -> Option<Self> {
60 Self::from_i64(n as i64)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected