Ord

Trait Ord 

1.0.0 (const: unstable) · Source
pub trait Ord: Eq + PartialOrd {
    // Required method
    fn cmp(&self, other: &Self) -> Ordering;

    // Provided methods
    fn max(self, other: Self) -> Self
       where Self: Sized { ... }
    fn min(self, other: Self) -> Self
       where Self: Sized { ... }
    fn clamp(self, min: Self, max: Self) -> Self
       where Self: Sized { ... }
}
Expand description

Trait for types that form a total order.

Implementations must be consistent with the PartialOrd implementation, and ensure max, min, and clamp are consistent with cmp:

  • partial_cmp(a, b) == Some(cmp(a, b)).
  • max(a, b) == max_by(a, b, cmp) (ensured by the default implementation).
  • min(a, b) == min_by(a, b, cmp) (ensured by the default implementation).
  • For a.clamp(min, max), see the method docs (ensured by the default implementation).

Violating these requirements is a logic error. The behavior resulting from a logic error is not specified, but users of the trait must ensure that such logic errors do not result in undefined behavior. This means that unsafe code must not rely on the correctness of these methods.

§Corollaries

From the above and the requirements of PartialOrd, it follows that for all a, b and c:

  • exactly one of a < b, a == b or a > b is true; and
  • < is transitive: a < b and b < c implies a < c. The same must hold for both == and >.

Mathematically speaking, the < operator defines a strict weak order. In cases where == conforms to mathematical equality, it also defines a strict total order.

§Derivable

This trait can be used with #[derive].

When derived on structs, it will produce a lexicographic ordering based on the top-to-bottom declaration order of the struct’s members.

When derived on enums, variants are ordered primarily by their discriminants. Secondarily, they are ordered by their fields. By default, the discriminant is smallest for variants at the top, and largest for variants at the bottom. Here’s an example:

#[derive(PartialEq, Eq, PartialOrd, Ord)]
enum E {
    Top,
    Bottom,
}

assert!(E::Top < E::Bottom);

However, manually setting the discriminants can override this default behavior:

#[derive(PartialEq, Eq, PartialOrd, Ord)]
enum E {
    Top = 2,
    Bottom = 1,
}

assert!(E::Bottom < E::Top);

§Lexicographical comparison

Lexicographical comparison is an operation with the following properties:

  • Two sequences are compared element by element.
  • The first mismatching element defines which sequence is lexicographically less or greater than the other.
  • If one sequence is a prefix of another, the shorter sequence is lexicographically less than the other.
  • If two sequences have equivalent elements and are of the same length, then the sequences are lexicographically equal.
  • An empty sequence is lexicographically less than any non-empty sequence.
  • Two empty sequences are lexicographically equal.

§How can I implement Ord?

Ord requires that the type also be PartialOrd, PartialEq, and Eq.

Because Ord implies a stronger ordering relationship than PartialOrd, and both Ord and PartialOrd must agree, you must choose how to implement Ord first. You can choose to derive it, or implement it manually. If you derive it, you should derive all four traits. If you implement it manually, you should manually implement all four traits, based on the implementation of Ord.

Here’s an example where you want to define the Character comparison by health and experience only, disregarding the field mana:

use std::cmp::Ordering;

struct Character {
    health: u32,
    experience: u32,
    mana: f32,
}

impl Ord for Character {
    fn cmp(&self, other: &Self) -> Ordering {
        self.experience
            .cmp(&other.experience)
            .then(self.health.cmp(&other.health))
    }
}

impl PartialOrd for Character {
    fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
        Some(self.cmp(other))
    }
}

impl PartialEq for Character {
    fn eq(&self, other: &Self) -> bool {
        self.health == other.health && self.experience == other.experience
    }
}

impl Eq for Character {}

If all you need is to slice::sort a type by a field value, it can be simpler to use slice::sort_by_key.

§Examples of incorrect Ord implementations

use std::cmp::Ordering;

#[derive(Debug)]
struct Character {
    health: f32,
}

impl Ord for Character {
    fn cmp(&self, other: &Self) -> std::cmp::Ordering {
        if self.health < other.health {
            Ordering::Less
        } else if self.health > other.health {
            Ordering::Greater
        } else {
            Ordering::Equal
        }
    }
}

impl PartialOrd for Character {
    fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
        Some(self.cmp(other))
    }
}

impl PartialEq for Character {
    fn eq(&self, other: &Self) -> bool {
        self.health == other.health
    }
}

impl Eq for Character {}

let a = Character { health: 4.5 };
let b = Character { health: f32::NAN };

// Mistake: floating-point values do not form a total order and using the built-in comparison
// operands to implement `Ord` irregardless of that reality does not change it. Use
// `f32::total_cmp` if you need a total order for floating-point values.

// Reflexivity requirement of `Ord` is not given.
assert!(a == a);
assert!(b != b);

// Antisymmetry requirement of `Ord` is not given. Only one of a < c and c < a is allowed to be
// true, not both or neither.
assert_eq!((a < b) as u8 + (b < a) as u8, 0);
use std::cmp::Ordering;

#[derive(Debug)]
struct Character {
    health: u32,
    experience: u32,
}

impl PartialOrd for Character {
    fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
        Some(self.cmp(other))
    }
}

impl Ord for Character {
    fn cmp(&self, other: &Self) -> std::cmp::Ordering {
        if self.health < 50 {
            self.health.cmp(&other.health)
        } else {
            self.experience.cmp(&other.experience)
        }
    }
}

// For performance reasons implementing `PartialEq` this way is not the idiomatic way, but it
// ensures consistent behavior between `PartialEq`, `PartialOrd` and `Ord` in this example.
impl PartialEq for Character {
    fn eq(&self, other: &Self) -> bool {
        self.cmp(other) == Ordering::Equal
    }
}

impl Eq for Character {}

let a = Character {
    health: 3,
    experience: 5,
};
let b = Character {
    health: 10,
    experience: 77,
};
let c = Character {
    health: 143,
    experience: 2,
};

// Mistake: The implementation of `Ord` compares different fields depending on the value of
// `self.health`, the resulting order is not total.

// Transitivity requirement of `Ord` is not given. If a is smaller than b and b is smaller than
// c, by transitive property a must also be smaller than c.
assert!(a < b && b < c && c < a);

// Antisymmetry requirement of `Ord` is not given. Only one of a < c and c < a is allowed to be
// true, not both or neither.
assert_eq!((a < c) as u8 + (c < a) as u8, 2);

The documentation of PartialOrd contains further examples, for example it’s wrong for PartialOrd and PartialEq to disagree.

Required Methods§

1.0.0 · Source

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other.

By convention, self.cmp(&other) returns the ordering matching the expression self <operator> other if true.

§Examples
use std::cmp::Ordering;

assert_eq!(5.cmp(&10), Ordering::Less);
assert_eq!(10.cmp(&5), Ordering::Greater);
assert_eq!(5.cmp(&5), Ordering::Equal);

Provided Methods§

1.21.0 · Source

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values.

Returns the second argument if the comparison determines them to be equal.

§Examples
assert_eq!(1.max(2), 2);
assert_eq!(2.max(2), 2);
use std::cmp::Ordering;

#[derive(Eq)]
struct Equal(&'static str);

impl PartialEq for Equal {
    fn eq(&self, other: &Self) -> bool { true }
}
impl PartialOrd for Equal {
    fn partial_cmp(&self, other: &Self) -> Option<Ordering> { Some(Ordering::Equal) }
}
impl Ord for Equal {
    fn cmp(&self, other: &Self) -> Ordering { Ordering::Equal }
}

assert_eq!(Equal("self").max(Equal("other")).0, "other");
1.21.0 · Source

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values.

Returns the first argument if the comparison determines them to be equal.

§Examples
assert_eq!(1.min(2), 1);
assert_eq!(2.min(2), 2);
use std::cmp::Ordering;

#[derive(Eq)]
struct Equal(&'static str);

impl PartialEq for Equal {
    fn eq(&self, other: &Self) -> bool { true }
}
impl PartialOrd for Equal {
    fn partial_cmp(&self, other: &Self) -> Option<Ordering> { Some(Ordering::Equal) }
}
impl Ord for Equal {
    fn cmp(&self, other: &Self) -> Ordering { Ordering::Equal }
}

assert_eq!(Equal("self").min(Equal("other")).0, "self");
1.50.0 · Source

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval.

Returns max if self is greater than max, and min if self is less than min. Otherwise this returns self.

§Panics

Panics if min > max.

§Examples
assert_eq!((-3).clamp(-2, 1), -2);
assert_eq!(0.clamp(-2, 1), 0);
assert_eq!(2.clamp(-2, 1), 1);

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Ord for AccountEntryExt

Source§

impl Ord for AccountEntryExtensionV1Ext

Source§

impl Ord for AccountEntryExtensionV2Ext

Source§

impl Ord for AccountFlags

Source§

impl Ord for AccountMergeResult

Source§

impl Ord for AccountMergeResultCode

Source§

impl Ord for AllowTrustResult

Source§

impl Ord for AllowTrustResultCode

Source§

impl Ord for ArchivalProofBody

Source§

impl Ord for ArchivalProofType

Source§

impl Ord for Asset

Source§

impl Ord for AssetCode

Source§

impl Ord for AssetType

Source§

impl Ord for AuthenticatedMessage

Source§

impl Ord for BeginSponsoringFutureReservesResult

Source§

impl Ord for BeginSponsoringFutureReservesResultCode

Source§

impl Ord for BinaryFuseFilterType

Source§

impl Ord for BucketEntry

Source§

impl Ord for BucketEntryType

Source§

impl Ord for BucketListType

Source§

impl Ord for BucketMetadataExt

Source§

impl Ord for BumpSequenceResult

Source§

impl Ord for BumpSequenceResultCode

Source§

impl Ord for ChangeTrustAsset

Source§

impl Ord for ChangeTrustResult

Source§

impl Ord for ChangeTrustResultCode

Source§

impl Ord for ClaimAtom

Source§

impl Ord for ClaimAtomType

Source§

impl Ord for ClaimClaimableBalanceResult

Source§

impl Ord for ClaimClaimableBalanceResultCode

Source§

impl Ord for ClaimPredicate

Source§

impl Ord for ClaimPredicateType

Source§

impl Ord for ClaimableBalanceEntryExt

Source§

impl Ord for ClaimableBalanceEntryExtensionV1Ext

Source§

impl Ord for ClaimableBalanceFlags

Source§

impl Ord for ClaimableBalanceId

Source§

impl Ord for ClaimableBalanceIdType

Source§

impl Ord for Claimant

Source§

impl Ord for ClaimantType

Source§

impl Ord for ClawbackClaimableBalanceResult

Source§

impl Ord for ClawbackClaimableBalanceResultCode

Source§

impl Ord for ClawbackResult

Source§

impl Ord for ClawbackResultCode

Source§

impl Ord for ColdArchiveBucketEntry

Source§

impl Ord for ColdArchiveBucketEntryType

Source§

impl Ord for ConfigSettingEntry

Source§

impl Ord for ConfigSettingId

Source§

impl Ord for ContractCodeEntryExt

Source§

impl Ord for ContractCostType

Source§

impl Ord for ContractDataDurability

Source§

impl Ord for ContractEventBody

Source§

impl Ord for ContractEventType

Source§

impl Ord for ContractExecutable

Source§

impl Ord for ContractExecutableType

Source§

impl Ord for ContractIdPreimage

Source§

impl Ord for ContractIdPreimageType

Source§

impl Ord for CreateAccountResult

Source§

impl Ord for CreateAccountResultCode

Source§

impl Ord for CreateClaimableBalanceResult

Source§

impl Ord for CreateClaimableBalanceResultCode

Source§

impl Ord for CryptoKeyType

Source§

impl Ord for DataEntryExt

Source§

impl Ord for EndSponsoringFutureReservesResult

Source§

impl Ord for EndSponsoringFutureReservesResultCode

Source§

impl Ord for EnvelopeType

Source§

impl Ord for ErrorCode

Source§

impl Ord for ExtendFootprintTtlResult

Source§

impl Ord for ExtendFootprintTtlResultCode

Source§

impl Ord for ExtensionPoint

Source§

impl Ord for FeeBumpTransactionExt

Source§

impl Ord for FeeBumpTransactionInnerTx

Source§

impl Ord for GeneralizedTransactionSet

Source§

impl Ord for HashIdPreimage

Source§

impl Ord for HostFunction

Source§

impl Ord for HostFunctionType

Source§

impl Ord for HotArchiveBucketEntry

Source§

impl Ord for HotArchiveBucketEntryType

Source§

impl Ord for InflationResult

Source§

impl Ord for InflationResultCode

Source§

impl Ord for InnerTransactionResultExt

Source§

impl Ord for InnerTransactionResultResult

Source§

impl Ord for InvokeHostFunctionResult

Source§

impl Ord for InvokeHostFunctionResultCode

Source§

impl Ord for IpAddrType

Source§

impl Ord for LedgerCloseMeta

Source§

impl Ord for LedgerCloseMetaExt

Source§

impl Ord for LedgerEntryChange

Source§

impl Ord for LedgerEntryChangeType

Source§

impl Ord for LedgerEntryData

Source§

impl Ord for LedgerEntryExt

Source§

impl Ord for LedgerEntryExtensionV1Ext

Source§

impl Ord for LedgerEntryType

Source§

impl Ord for LedgerHeaderExt

Source§

impl Ord for LedgerHeaderExtensionV1Ext

Source§

impl Ord for LedgerHeaderFlags

Source§

impl Ord for LedgerHeaderHistoryEntryExt

Source§

impl Ord for LedgerKey

Source§

impl Ord for LedgerUpgrade

Source§

impl Ord for LedgerUpgradeType

Source§

impl Ord for LiquidityPoolDepositResult

Source§

impl Ord for LiquidityPoolDepositResultCode

Source§

impl Ord for LiquidityPoolEntryBody

Source§

impl Ord for LiquidityPoolParameters

Source§

impl Ord for LiquidityPoolType

Source§

impl Ord for LiquidityPoolWithdrawResult

Source§

impl Ord for LiquidityPoolWithdrawResultCode

Source§

impl Ord for ManageBuyOfferResult

Source§

impl Ord for ManageBuyOfferResultCode

Source§

impl Ord for ManageDataResult

Source§

impl Ord for ManageDataResultCode

Source§

impl Ord for ManageOfferEffect

Source§

impl Ord for ManageOfferSuccessResultOffer

Source§

impl Ord for ManageSellOfferResult

Source§

impl Ord for ManageSellOfferResultCode

Source§

impl Ord for Memo

Source§

impl Ord for MemoType

Source§

impl Ord for MessageType

Source§

impl Ord for loam_sdk::soroban_sdk::xdr::MuxedAccount

Source§

impl Ord for OfferEntryExt

Source§

impl Ord for OfferEntryFlags

Source§

impl Ord for OperationBody

Source§

impl Ord for OperationResult

Source§

impl Ord for OperationResultCode

Source§

impl Ord for OperationResultTr

Source§

impl Ord for OperationType

Source§

impl Ord for PathPaymentStrictReceiveResult

Source§

impl Ord for PathPaymentStrictReceiveResultCode

Source§

impl Ord for PathPaymentStrictSendResult

Source§

impl Ord for PathPaymentStrictSendResultCode

Source§

impl Ord for PaymentResult

Source§

impl Ord for PaymentResultCode

Source§

impl Ord for PeerAddressIp

Source§

impl Ord for PersistedScpState

Source§

impl Ord for PreconditionType

Source§

impl Ord for Preconditions

Source§

impl Ord for loam_sdk::soroban_sdk::xdr::PublicKey

Source§

impl Ord for PublicKeyType

Source§

impl Ord for RestoreFootprintResult

Source§

impl Ord for RestoreFootprintResultCode

Source§

impl Ord for RevokeSponsorshipOp

Source§

impl Ord for RevokeSponsorshipResult

Source§

impl Ord for RevokeSponsorshipResultCode

Source§

impl Ord for RevokeSponsorshipType

Source§

impl Ord for ScAddress

Source§

impl Ord for ScAddressType

Source§

impl Ord for ScEnvMetaEntry

Source§

impl Ord for ScEnvMetaKind

Source§

impl Ord for ScError

Source§

impl Ord for ScErrorCode

Source§

impl Ord for ScErrorType

Source§

impl Ord for ScMetaEntry

Source§

impl Ord for ScMetaKind

Source§

impl Ord for ScSpecEntry

Source§

impl Ord for ScSpecEntryKind

Source§

impl Ord for ScSpecType

Source§

impl Ord for ScSpecTypeDef

Source§

impl Ord for ScSpecUdtUnionCaseV0

Source§

impl Ord for ScSpecUdtUnionCaseV0Kind

Source§

impl Ord for ScVal

Source§

impl Ord for ScValType

Source§

impl Ord for ScpHistoryEntry

Source§

impl Ord for ScpStatementPledges

Source§

impl Ord for ScpStatementType

Source§

impl Ord for SetOptionsResult

Source§

impl Ord for SetOptionsResultCode

Source§

impl Ord for SetTrustLineFlagsResult

Source§

impl Ord for SetTrustLineFlagsResultCode

Source§

impl Ord for SignerKey

Source§

impl Ord for SignerKeyType

Source§

impl Ord for SorobanAuthorizedFunction

Source§

impl Ord for SorobanAuthorizedFunctionType

Source§

impl Ord for SorobanCredentials

Source§

impl Ord for SorobanCredentialsType

Source§

impl Ord for SorobanTransactionMetaExt

Source§

impl Ord for StellarMessage

Source§

impl Ord for StellarValueExt

Source§

impl Ord for StellarValueType

Source§

impl Ord for StoredTransactionSet

Source§

impl Ord for SurveyMessageCommandType

Source§

impl Ord for SurveyMessageResponseType

Source§

impl Ord for SurveyResponseBody

Source§

impl Ord for ThresholdIndexes

Source§

impl Ord for TransactionEnvelope

Source§

impl Ord for TransactionExt

Source§

impl Ord for TransactionHistoryEntryExt

Source§

impl Ord for TransactionHistoryResultEntryExt

Source§

impl Ord for TransactionMeta

Source§

impl Ord for TransactionPhase

Source§

impl Ord for TransactionResultCode

Source§

impl Ord for TransactionResultExt

Source§

impl Ord for TransactionResultResult

Source§

impl Ord for TransactionSignaturePayloadTaggedTransaction

Source§

impl Ord for TransactionV0Ext

Source§

impl Ord for TrustLineAsset

Source§

impl Ord for TrustLineEntryExt

Source§

impl Ord for TrustLineEntryExtensionV2Ext

Source§

impl Ord for TrustLineEntryV1Ext

Source§

impl Ord for TrustLineFlags

Source§

impl Ord for TxSetComponent

Source§

impl Ord for TxSetComponentType

Source§

impl Ord for Type

Source§

impl Ord for TypeVariant

Source§

impl Ord for AsciiChar

1.34.0 (const: unstable) · Source§

impl Ord for Infallible

1.0.0 · Source§

impl Ord for loam_sdk::soroban_sdk::testutils::arbitrary::std::io::ErrorKind

1.7.0 · Source§

impl Ord for IpAddr

1.0.0 · Source§

impl Ord for SocketAddr

1.0.0 (const: unstable) · Source§

impl Ord for Ordering

Source§

impl Ord for ark_std::io::error::ErrorKind

Source§

impl Ord for const_oid::error::Error

Source§

impl Ord for Class

Source§

impl Ord for der::tag::Tag

Source§

impl Ord for TagMode

Source§

impl Ord for UnescapeError

Source§

impl Ord for Sign

Source§

impl Ord for soroban_env_common::val::Tag

Source§

impl Ord for AccessType

Source§

impl Ord for DecodeError

Source§

impl Ord for Strkey

Source§

impl Ord for ValueType

Source§

impl Ord for BigEndian

Source§

impl Ord for LittleEndian

1.0.0 (const: unstable) · Source§

impl Ord for bool

1.0.0 (const: unstable) · Source§

impl Ord for char

1.0.0 (const: unstable) · Source§

impl Ord for i8

1.0.0 (const: unstable) · Source§

impl Ord for i16

1.0.0 (const: unstable) · Source§

impl Ord for i32

1.0.0 (const: unstable) · Source§

impl Ord for i64

1.0.0 (const: unstable) · Source§

impl Ord for i128

1.0.0 (const: unstable) · Source§

impl Ord for isize

Source§

impl Ord for !

1.0.0 · Source§

impl Ord for str

Implements ordering of strings.

Strings are ordered lexicographically by their byte values. This orders Unicode code points based on their positions in the code charts. This is not necessarily the same as “alphabetical” order, which varies by language and locale. Sorting strings according to culturally-accepted standards requires locale-specific data that is outside the scope of the str type.

1.0.0 (const: unstable) · Source§

impl Ord for u8

1.0.0 (const: unstable) · Source§

impl Ord for u16

1.0.0 (const: unstable) · Source§

impl Ord for u32

1.0.0 (const: unstable) · Source§

impl Ord for u64

1.0.0 (const: unstable) · Source§

impl Ord for u128

1.0.0 (const: unstable) · Source§

impl Ord for ()

1.0.0 (const: unstable) · Source§

impl Ord for usize

Source§

impl Ord for Address

Source§

impl Ord for Bytes

Source§

impl Ord for loam_sdk::soroban_sdk::Duration

Source§

impl Ord for loam_sdk::soroban_sdk::Error

Source§

impl Ord for loam_sdk::soroban_sdk::I256

Source§

impl Ord for loam_sdk::soroban_sdk::String

Source§

impl Ord for Symbol

Source§

impl Ord for SymbolStr

Source§

impl Ord for Timepoint

Source§

impl Ord for loam_sdk::soroban_sdk::U256

Source§

impl Ord for AccountEntry

Source§

impl Ord for AccountEntryExtensionV1

Source§

impl Ord for AccountEntryExtensionV2

Source§

impl Ord for AccountEntryExtensionV3

Source§

impl Ord for AccountId

Source§

impl Ord for AllowTrustOp

Source§

impl Ord for AlphaNum4

Source§

impl Ord for AlphaNum12

Source§

impl Ord for ArchivalProof

Source§

impl Ord for ArchivalProofNode

Source§

impl Ord for AssetCode4

Source§

impl Ord for AssetCode12

Source§

impl Ord for Auth

Source§

impl Ord for AuthCert

Source§

impl Ord for AuthenticatedMessageV0

Source§

impl Ord for BeginSponsoringFutureReservesOp

Source§

impl Ord for BucketMetadata

Source§

impl Ord for BumpSequenceOp

Source§

impl Ord for ChangeTrustOp

Source§

impl Ord for ClaimClaimableBalanceOp

Source§

impl Ord for ClaimLiquidityAtom

Source§

impl Ord for ClaimOfferAtom

Source§

impl Ord for ClaimOfferAtomV0

Source§

impl Ord for ClaimableBalanceEntry

Source§

impl Ord for ClaimableBalanceEntryExtensionV1

Source§

impl Ord for ClaimantV0

Source§

impl Ord for ClawbackClaimableBalanceOp

Source§

impl Ord for ClawbackOp

Source§

impl Ord for ColdArchiveArchivedLeaf

Source§

impl Ord for ColdArchiveBoundaryLeaf

Source§

impl Ord for ColdArchiveDeletedLeaf

Source§

impl Ord for ColdArchiveHashEntry

Source§

impl Ord for ConfigSettingContractBandwidthV0

Source§

impl Ord for ConfigSettingContractComputeV0

Source§

impl Ord for ConfigSettingContractEventsV0

Source§

impl Ord for ConfigSettingContractExecutionLanesV0

Source§

impl Ord for ConfigSettingContractHistoricalDataV0

Source§

impl Ord for ConfigSettingContractLedgerCostV0

Source§

impl Ord for ConfigUpgradeSet

Source§

impl Ord for ConfigUpgradeSetKey

Source§

impl Ord for ContractCodeCostInputs

Source§

impl Ord for ContractCodeEntry

Source§

impl Ord for ContractCodeEntryV1

Source§

impl Ord for ContractCostParamEntry

Source§

impl Ord for ContractCostParams

Source§

impl Ord for ContractDataEntry

Source§

impl Ord for ContractEvent

Source§

impl Ord for ContractEventV0

Source§

impl Ord for ContractIdPreimageFromAddress

Source§

impl Ord for CreateAccountOp

Source§

impl Ord for CreateClaimableBalanceOp

Source§

impl Ord for CreateContractArgs

Source§

impl Ord for CreateContractArgsV2

Source§

impl Ord for CreatePassiveSellOfferOp

Source§

impl Ord for Curve25519Public

Source§

impl Ord for Curve25519Secret

Source§

impl Ord for DataEntry

Source§

impl Ord for DataValue

Source§

impl Ord for DecoratedSignature

Source§

impl Ord for DiagnosticEvent

Source§

impl Ord for DiagnosticEvents

Source§

impl Ord for DontHave

Source§

impl Ord for loam_sdk::soroban_sdk::xdr::Duration

Source§

impl Ord for EncryptedBody

Source§

impl Ord for EvictionIterator

Source§

impl Ord for ExistenceProofBody

Source§

impl Ord for ExtendFootprintTtlOp

Source§

impl Ord for FeeBumpTransaction

Source§

impl Ord for FeeBumpTransactionEnvelope

Source§

impl Ord for FloodAdvert

Source§

impl Ord for FloodDemand

Source§

impl Ord for Hash

Source§

impl Ord for HashIdPreimageContractId

Source§

impl Ord for HashIdPreimageOperationId

Source§

impl Ord for HashIdPreimageRevokeId

Source§

impl Ord for HashIdPreimageSorobanAuthorization

Source§

impl Ord for Hello

Source§

impl Ord for HmacSha256Key

Source§

impl Ord for HmacSha256Mac

Source§

impl Ord for InflationPayout

Source§

impl Ord for InnerTransactionResult

Source§

impl Ord for InnerTransactionResultPair

Source§

impl Ord for Int128Parts

Source§

impl Ord for Int256Parts

Source§

impl Ord for InvokeContractArgs

Source§

impl Ord for InvokeHostFunctionOp

Source§

impl Ord for InvokeHostFunctionSuccessPreImage

Source§

impl Ord for LedgerBounds

Source§

impl Ord for LedgerCloseMetaExtV1

Source§

impl Ord for LedgerCloseMetaV0

Source§

impl Ord for LedgerCloseMetaV1

Source§

impl Ord for LedgerCloseValueSignature

Source§

impl Ord for LedgerEntry

Source§

impl Ord for LedgerEntryChanges

Source§

impl Ord for LedgerEntryExtensionV1

Source§

impl Ord for LedgerFootprint

Source§

impl Ord for LedgerHeader

Source§

impl Ord for LedgerHeaderExtensionV1

Source§

impl Ord for LedgerHeaderHistoryEntry

Source§

impl Ord for LedgerKeyAccount

Source§

impl Ord for LedgerKeyClaimableBalance

Source§

impl Ord for LedgerKeyConfigSetting

Source§

impl Ord for LedgerKeyContractCode

Source§

impl Ord for LedgerKeyContractData

Source§

impl Ord for LedgerKeyData

Source§

impl Ord for LedgerKeyLiquidityPool

Source§

impl Ord for LedgerKeyOffer

Source§

impl Ord for LedgerKeyTrustLine

Source§

impl Ord for LedgerKeyTtl

Source§

impl Ord for LedgerScpMessages

Source§

impl Ord for Liabilities

Source§

impl Ord for Limits

Source§

impl Ord for LiquidityPoolConstantProductParameters

Source§

impl Ord for LiquidityPoolDepositOp

Source§

impl Ord for LiquidityPoolEntry

Source§

impl Ord for LiquidityPoolEntryConstantProduct

Source§

impl Ord for LiquidityPoolWithdrawOp

Source§

impl Ord for ManageBuyOfferOp

Source§

impl Ord for ManageDataOp

Source§

impl Ord for ManageOfferSuccessResult

Source§

impl Ord for ManageSellOfferOp

Source§

impl Ord for MuxedAccountMed25519

Source§

impl Ord for NodeId

Source§

impl Ord for NonexistenceProofBody

Source§

impl Ord for OfferEntry

Source§

impl Ord for Operation

Source§

impl Ord for OperationMeta

Source§

impl Ord for PathPaymentStrictReceiveOp

Source§

impl Ord for PathPaymentStrictReceiveResultSuccess

Source§

impl Ord for PathPaymentStrictSendOp

Source§

impl Ord for PathPaymentStrictSendResultSuccess

Source§

impl Ord for PaymentOp

Source§

impl Ord for PeerAddress

Source§

impl Ord for PeerStatList

Source§

impl Ord for PeerStats

Source§

impl Ord for PersistedScpStateV0

Source§

impl Ord for PersistedScpStateV1

Source§

impl Ord for PoolId

Source§

impl Ord for PreconditionsV2

Source§

impl Ord for Price

Source§

impl Ord for ProofLevel

Source§

impl Ord for RestoreFootprintOp

Source§

impl Ord for RevokeSponsorshipOpSigner

Source§

impl Ord for SError

Source§

impl Ord for ScBytes

Source§

impl Ord for ScContractInstance

Source§

impl Ord for ScEnvMetaEntryInterfaceVersion

Source§

impl Ord for ScMap

Source§

impl Ord for ScMapEntry

Source§

impl Ord for ScMetaV0

Source§

impl Ord for ScNonceKey

Source§

impl Ord for ScSpecFunctionInputV0

Source§

impl Ord for ScSpecFunctionV0

Source§

impl Ord for ScSpecTypeBytesN

Source§

impl Ord for ScSpecTypeMap

Source§

impl Ord for ScSpecTypeOption

Source§

impl Ord for ScSpecTypeResult

Source§

impl Ord for ScSpecTypeTuple

Source§

impl Ord for ScSpecTypeUdt

Source§

impl Ord for ScSpecTypeVec

Source§

impl Ord for ScSpecUdtEnumCaseV0

Source§

impl Ord for ScSpecUdtEnumV0

Source§

impl Ord for ScSpecUdtErrorEnumCaseV0

Source§

impl Ord for ScSpecUdtErrorEnumV0

Source§

impl Ord for ScSpecUdtStructFieldV0

Source§

impl Ord for ScSpecUdtStructV0

Source§

impl Ord for ScSpecUdtUnionCaseTupleV0

Source§

impl Ord for ScSpecUdtUnionCaseVoidV0

Source§

impl Ord for ScSpecUdtUnionV0

Source§

impl Ord for ScString

Source§

impl Ord for ScSymbol

Source§

impl Ord for ScVec

Source§

impl Ord for ScpBallot

Source§

impl Ord for ScpEnvelope

Source§

impl Ord for ScpHistoryEntryV0

Source§

impl Ord for ScpNomination

Source§

impl Ord for ScpQuorumSet

Source§

impl Ord for ScpStatement

Source§

impl Ord for ScpStatementConfirm

Source§

impl Ord for ScpStatementExternalize

Source§

impl Ord for ScpStatementPrepare

Source§

impl Ord for SendMore

Source§

impl Ord for SendMoreExtended

Source§

impl Ord for SequenceNumber

Source§

impl Ord for SerializedBinaryFuseFilter

Source§

impl Ord for SetOptionsOp

Source§

impl Ord for SetTrustLineFlagsOp

Source§

impl Ord for ShortHashSeed

Source§

impl Ord for Signature

Source§

impl Ord for SignatureHint

Source§

impl Ord for SignedSurveyRequestMessage

Source§

impl Ord for SignedSurveyResponseMessage

Source§

impl Ord for SignedTimeSlicedSurveyRequestMessage

Source§

impl Ord for SignedTimeSlicedSurveyResponseMessage

Source§

impl Ord for SignedTimeSlicedSurveyStartCollectingMessage

Source§

impl Ord for SignedTimeSlicedSurveyStopCollectingMessage

Source§

impl Ord for Signer

Source§

impl Ord for SignerKeyEd25519SignedPayload

Source§

impl Ord for SimplePaymentResult

Source§

impl Ord for SorobanAddressCredentials

Source§

impl Ord for SorobanAuthorizationEntry

Source§

impl Ord for SorobanAuthorizedInvocation

Source§

impl Ord for SorobanResources

Source§

impl Ord for SorobanTransactionData

Source§

impl Ord for SorobanTransactionMeta

Source§

impl Ord for SorobanTransactionMetaExtV1

Source§

impl Ord for SponsorshipDescriptor

Source§

impl Ord for StateArchivalSettings

Source§

impl Ord for StellarValue

Source§

impl Ord for StoredDebugTransactionSet

Source§

impl Ord for String32

Source§

impl Ord for String64

Source§

impl Ord for SurveyRequestMessage

Source§

impl Ord for SurveyResponseMessage

Source§

impl Ord for Thresholds

Source§

impl Ord for TimeBounds

Source§

impl Ord for TimePoint

Source§

impl Ord for TimeSlicedNodeData

Source§

impl Ord for TimeSlicedPeerData

Source§

impl Ord for TimeSlicedPeerDataList

Source§

impl Ord for TimeSlicedSurveyRequestMessage

Source§

impl Ord for TimeSlicedSurveyResponseMessage

Source§

impl Ord for TimeSlicedSurveyStartCollectingMessage

Source§

impl Ord for TimeSlicedSurveyStopCollectingMessage

Source§

impl Ord for TopologyResponseBodyV0

Source§

impl Ord for TopologyResponseBodyV1

Source§

impl Ord for TopologyResponseBodyV2

Source§

impl Ord for Transaction

Source§

impl Ord for TransactionHistoryEntry

Source§

impl Ord for TransactionHistoryResultEntry

Source§

impl Ord for TransactionMetaV1

Source§

impl Ord for TransactionMetaV2

Source§

impl Ord for TransactionMetaV3

Source§

impl Ord for TransactionResult

Source§

impl Ord for TransactionResultMeta

Source§

impl Ord for TransactionResultPair

Source§

impl Ord for TransactionResultSet

Source§

impl Ord for TransactionSet

Source§

impl Ord for TransactionSetV1

Source§

impl Ord for TransactionSignaturePayload

Source§

impl Ord for TransactionV0

Source§

impl Ord for TransactionV0Envelope

Source§

impl Ord for TransactionV1Envelope

Source§

impl Ord for TrustLineEntry

Source§

impl Ord for TrustLineEntryExtensionV2

Source§

impl Ord for TrustLineEntryV1

Source§

impl Ord for TtlEntry

Source§

impl Ord for TxAdvertVector

Source§

impl Ord for TxDemandVector

Source§

impl Ord for TxSetComponentTxsMaybeDiscountedFee

Source§

impl Ord for UInt128Parts

Source§

impl Ord for UInt256Parts

Source§

impl Ord for Uint256

Source§

impl Ord for UpgradeEntryMeta

Source§

impl Ord for UpgradeType

Source§

impl Ord for Value

1.0.0 · Source§

impl Ord for TypeId

1.27.0 · Source§

impl Ord for CpuidResult

Source§

impl Ord for ByteStr

Source§

impl Ord for ByteString

1.0.0 · Source§

impl Ord for CStr

1.64.0 · Source§

impl Ord for CString

1.0.0 · Source§

impl Ord for OsStr

1.0.0 · Source§

impl Ord for OsString

1.0.0 · Source§

impl Ord for loam_sdk::soroban_sdk::testutils::arbitrary::std::fmt::Error

1.33.0 · Source§

impl Ord for PhantomPinned

1.0.0 · Source§

impl Ord for Ipv4Addr

1.0.0 · Source§

impl Ord for Ipv6Addr

1.0.0 · Source§

impl Ord for SocketAddrV4

1.0.0 · Source§

impl Ord for SocketAddrV6

1.10.0 · Source§

impl Ord for Location<'_>

1.0.0 · Source§

impl Ord for Components<'_>

1.0.0 · Source§

impl Ord for Path

1.0.0 · Source§

impl Ord for PathBuf

1.0.0 · Source§

impl Ord for PrefixComponent<'_>

Source§

impl Ord for Alignment

1.0.0 · Source§

impl Ord for loam_sdk::soroban_sdk::testutils::arbitrary::std::string::String

1.3.0 · Source§

impl Ord for loam_sdk::soroban_sdk::testutils::arbitrary::std::time::Duration

1.8.0 · Source§

impl Ord for Instant

1.8.0 · Source§

impl Ord for SystemTime

Source§

impl Ord for SparseTerm

Source§

impl Ord for ObjectIdentifier

Source§

impl Ord for Limb

Source§

impl Ord for GeneralizedTime

Source§

impl Ord for Null

Source§

impl Ord for UtcTime

Source§

impl Ord for DateTime

Source§

impl Ord for IndefiniteLength

Source§

impl Ord for Length

Source§

impl Ord for TagNumber

Source§

impl Ord for RecoveryId

Source§

impl Ord for ethnum::int::I256

Source§

impl Ord for ethnum::uint::U256

Source§

impl Ord for k256::arithmetic::scalar::Scalar

Source§

impl Ord for Secp256k1

Source§

impl Ord for num_bigint::bigint::BigInt

Source§

impl Ord for BigUint

Source§

impl Ord for p256::arithmetic::scalar::Scalar

Source§

impl Ord for NistP256

Source§

impl Ord for BuildMetadata

Source§

impl Ord for Prerelease

Source§

impl Ord for semver::Version

Source§

impl Ord for DurationSmall

Source§

impl Ord for I64Small

Source§

impl Ord for I128Small

Source§

impl Ord for I256Small

Source§

impl Ord for TimepointSmall

Source§

impl Ord for U64Small

Source§

impl Ord for U128Small

Source§

impl Ord for U256Small

Source§

impl Ord for ScValObject

Source§

impl Ord for SymbolSmall

Source§

impl Ord for CostTracker

Source§

impl Ord for FuncType

Source§

impl Ord for stellar_strkey::ed25519::MuxedAccount

Source§

impl Ord for PrivateKey

Source§

impl Ord for stellar_strkey::ed25519::PublicKey

Source§

impl Ord for SignedPayload

Source§

impl Ord for Contract

Source§

impl Ord for HashX

Source§

impl Ord for PreAuthTx

Source§

impl Ord for ATerm

Source§

impl Ord for B0

Source§

impl Ord for B1

Source§

impl Ord for Z0

Source§

impl Ord for Equal

Source§

impl Ord for Greater

Source§

impl Ord for Less

Source§

impl Ord for UTerm

Source§

impl Ord for Pages

Source§

impl Ord for UntypedValue

Source§

impl Ord for KebabStr

Source§

impl Ord for KebabString

Source§

impl Ord for ResourceId

1.0.0 · Source§

impl<'a> Ord for Component<'a>

1.0.0 · Source§

impl<'a> Ord for Prefix<'a>

Source§

impl<'a> Ord for MockAuth<'a>

Source§

impl<'a> Ord for MockAuthInvoke<'a>

Source§

impl<'a> Ord for PhantomContravariantLifetime<'a>

Source§

impl<'a> Ord for PhantomCovariantLifetime<'a>

Source§

impl<'a> Ord for PhantomInvariantLifetime<'a>

Source§

impl<'a> Ord for AnyRef<'a>

Source§

impl<'a> Ord for BitStringRef<'a>

Source§

impl<'a> Ord for Ia5StringRef<'a>

Source§

impl<'a> Ord for IntRef<'a>

Source§

impl<'a> Ord for UintRef<'a>

Source§

impl<'a> Ord for OctetStringRef<'a>

Source§

impl<'a> Ord for PrintableStringRef<'a>

Source§

impl<'a> Ord for TeletexStringRef<'a>

Source§

impl<'a> Ord for Utf8StringRef<'a>

Source§

impl<'a> Ord for VideotexStringRef<'a>

Source§

impl<'a> Ord for ScValObjRef<'a>

Source§

impl<'a> Ord for soroban_env_common::Version<'a>

Source§

impl<'a> Ord for stellar_strkey::Version<'a>

Source§

impl<'a> Ord for stellar_xdr::Version<'a>

Source§

impl<'a, T> Ord for ContextSpecificRef<'a, T>
where T: Ord,

1.0.0 (const: unstable) · Source§

impl<A> Ord for &A
where A: Ord + ?Sized,

1.0.0 (const: unstable) · Source§

impl<A> Ord for &mut A
where A: Ord + ?Sized,

Source§

impl<A> Ord for SmallVec<A>
where A: Array, <A as Array>::Item: Ord,

1.0.0 · Source§

impl<B> Ord for Cow<'_, B>
where B: Ord + ToOwned + ?Sized,

Source§

impl<C> Ord for VerifyingKey<C>

Source§

impl<C> Ord for elliptic_curve::public_key::PublicKey<C>

Source§

impl<C> Ord for ScalarPrimitive<C>
where C: Curve,

Source§

impl<Dyn> Ord for DynMetadata<Dyn>
where Dyn: ?Sized,

1.4.0 · Source§

impl<F> Ord for F
where F: FnPtr,

Source§

impl<K, V> Ord for Map<K, V>

Source§

impl<K, V> Ord for IndexMap<K, V>
where K: Ord, V: Ord,

Source§

impl<K, V> Ord for indexmap::map::slice::Slice<K, V>
where K: Ord, V: Ord,

1.0.0 · Source§

impl<K, V, A> Ord for BTreeMap<K, V, A>
where K: Ord, V: Ord, A: Allocator + Clone,

Source§

impl<L, R> Ord for Either<L, R>
where L: Ord, R: Ord,

Source§

impl<O> Ord for I16<O>
where O: ByteOrder,

Source§

impl<O> Ord for I32<O>
where O: ByteOrder,

Source§

impl<O> Ord for I64<O>
where O: ByteOrder,

Source§

impl<O> Ord for I128<O>
where O: ByteOrder,

Source§

impl<O> Ord for Isize<O>
where O: ByteOrder,

Source§

impl<O> Ord for U16<O>
where O: ByteOrder,

Source§

impl<O> Ord for U32<O>
where O: ByteOrder,

Source§

impl<O> Ord for U64<O>
where O: ByteOrder,

Source§

impl<O> Ord for U128<O>
where O: ByteOrder,

Source§

impl<O> Ord for Usize<O>
where O: ByteOrder,

Source§

impl<P> Ord for MillerLoopOutput<P>
where P: Pairing,

Source§

impl<P> Ord for PairingOutput<P>
where P: Pairing,

Source§

impl<P> Ord for CubicExtField<P>
where P: CubicExtConfig,

CubicExtField elements are ordered lexicographically.

Source§

impl<P> Ord for QuadExtField<P>
where P: QuadExtConfig,

QuadExtField elements are ordered lexicographically.

Source§

impl<P, const N: usize> Ord for Fp<P, N>
where P: FpConfig<N>,

Note that this implementation of Ord compares field elements viewing them as integers in the range 0, 1, …, P::MODULUS - 1. However, other implementations of PrimeField might choose a different ordering, and as such, users should use this Ord for applications where any ordering suffices (like in a BTreeMap), and not in applications where a particular ordering is required.

1.41.0 · Source§

impl<Ptr> Ord for Pin<Ptr>
where Ptr: Deref, <Ptr as Deref>::Target: Ord,

Source§

impl<Size> Ord for EncodedPoint<Size>
where Size: ModulusSize,

1.0.0 (const: unstable) · Source§

impl<T> Ord for Option<T>
where T: Ord,

1.36.0 · Source§

impl<T> Ord for Poll<T>
where T: Ord,

1.0.0 · Source§

impl<T> Ord for *const T
where T: ?Sized,

Pointer comparison is by address, as produced by the [<*const T>::addr](pointer::addr) method.

1.0.0 · Source§

impl<T> Ord for *mut T
where T: ?Sized,

Pointer comparison is by address, as produced by the <*mut T>::addr method.

1.0.0 · Source§

impl<T> Ord for [T]
where T: Ord,

Implements comparison of slices lexicographically.

1.0.0 (const: unstable) · Source§

impl<T> Ord for (T₁, T₂, …, Tₙ)
where T: Ord,

This trait is implemented for tuples up to twelve items long.

Source§

impl<T> Ord for loam_sdk::soroban_sdk::Vec<T>
where T: IntoVal<Env, Val> + TryFromVal<Env, Val>,

Source§

impl<T> Ord for Frame<T>
where T: Ord + ReadXdr,

1.10.0 · Source§

impl<T> Ord for Cell<T>
where T: Ord + Copy,

1.10.0 · Source§

impl<T> Ord for RefCell<T>
where T: Ord + ?Sized,

Source§

impl<T> Ord for PhantomContravariant<T>
where T: ?Sized,

Source§

impl<T> Ord for PhantomCovariant<T>
where T: ?Sized,

1.0.0 · Source§

impl<T> Ord for PhantomData<T>
where T: ?Sized,

Source§

impl<T> Ord for PhantomInvariant<T>
where T: ?Sized,

1.20.0 · Source§

impl<T> Ord for ManuallyDrop<T>
where T: Ord + ?Sized,

1.28.0 (const: unstable) · Source§

impl<T> Ord for loam_sdk::soroban_sdk::testutils::arbitrary::std::num::NonZero<T>

1.74.0 · Source§

impl<T> Ord for Saturating<T>
where T: Ord,

1.0.0 · Source§

impl<T> Ord for loam_sdk::soroban_sdk::testutils::arbitrary::std::num::Wrapping<T>
where T: Ord,

1.25.0 · Source§

impl<T> Ord for NonNull<T>
where T: ?Sized,

Source§

impl<T> Ord for Exclusive<T>
where T: Sync + Ord + ?Sized,

Source§

impl<T> Ord for crypto_bigint::non_zero::NonZero<T>
where T: Ord + Zero,

Source§

impl<T> Ord for crypto_bigint::wrapping::Wrapping<T>
where T: Ord,

Source§

impl<T> Ord for ContextSpecific<T>
where T: Ord,

Source§

impl<T> Ord for IndexSet<T>
where T: Ord,

Source§

impl<T> Ord for indexmap::set::slice::Slice<T>
where T: Ord,

Source§

impl<T> Ord for Unalign<T>
where T: Unaligned + Ord,

1.19.0 (const: unstable) · Source§

impl<T> Ord for Reverse<T>
where T: Ord,

1.0.0 · Source§

impl<T, A> Ord for Box<T, A>
where T: Ord + ?Sized, A: Allocator,

1.0.0 · Source§

impl<T, A> Ord for BTreeSet<T, A>
where T: Ord, A: Allocator + Clone,

1.0.0 · Source§

impl<T, A> Ord for LinkedList<T, A>
where T: Ord, A: Allocator,

1.0.0 · Source§

impl<T, A> Ord for VecDeque<T, A>
where T: Ord, A: Allocator,

1.0.0 · Source§

impl<T, A> Ord for Rc<T, A>
where T: Ord + ?Sized, A: Allocator,

Source§

impl<T, A> Ord for UniqueRc<T, A>
where T: Ord + ?Sized, A: Allocator,

1.0.0 · Source§

impl<T, A> Ord for Arc<T, A>
where T: Ord + ?Sized, A: Allocator,

Source§

impl<T, A> Ord for UniqueArc<T, A>
where T: Ord + ?Sized, A: Allocator,

1.0.0 · Source§

impl<T, A> Ord for loam_sdk::soroban_sdk::testutils::arbitrary::std::vec::Vec<T, A>
where T: Ord, A: Allocator,

Implements ordering of vectors, lexicographically.

Source§

impl<T, B> Ord for Ref<B, T>

1.0.0 (const: unstable) · Source§

impl<T, E> Ord for Result<T, E>
where T: Ord, E: Ord,

Source§

impl<T, N> Ord for GenericArray<T, N>
where T: Ord, N: ArrayLength<T>,

Source§

impl<T, const MAX: u32> Ord for VecM<T, MAX>
where T: Ord,

1.0.0 · Source§

impl<T, const N: usize> Ord for [T; N]
where T: Ord,

Implements comparison of arrays lexicographically.

Source§

impl<T, const N: usize> Ord for Simd<T, N>

Lexicographic order. For the SIMD elementwise minimum and maximum, use simd_min and simd_max instead.

Source§

impl<T, const N: usize> Ord for SetOf<T, N>
where T: Ord + DerOrd,

Source§

impl<U> Ord for NInt<U>
where U: Ord + Unsigned + NonZero,

Source§

impl<U> Ord for PInt<U>
where U: Ord + Unsigned + NonZero,

Source§

impl<U, B> Ord for UInt<U, B>
where U: Ord, B: Ord,

Source§

impl<V, A> Ord for TArr<V, A>
where V: Ord, A: Ord,

Source§

impl<Y, R> Ord for CoroutineState<Y, R>
where Y: Ord, R: Ord,

Source§

impl<const LIMBS: usize> Ord for Uint<LIMBS>

Source§

impl<const MAX: u32> Ord for BytesM<MAX>

Source§

impl<const MAX: u32> Ord for StringM<MAX>

Source§

impl<const N: usize> Ord for BytesN<N>

Source§

impl<const N: usize> Ord for ark_ff::biginteger::BigInt<N>