Skip to main content

ErrorReason

Enum ErrorReason 

#[non_exhaustive]
#[repr(i32)]
pub enum ErrorReason { Unknown = 0, FieldInvalid = 1, FieldMissing = 2, InsufficientGasBalance = 3, TransactionExecutionFailed = 4, AboveLatestAvailable = 5, BelowEarliestAvailable = 6, ObjectRemoved = 7, NotServedHere = 8, NotReady = 9, VersionNotRetained = 10, }
Expand description

Error reasons in the sui.io error domain, used as the reason of a google.rpc.ErrorInfo or of a google.rpc.BadRequest.FieldViolation.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Unknown = 0

§

FieldInvalid = 1

§

FieldMissing = 2

§

InsufficientGasBalance = 3

Gas selection could not find enough SUI to cover the gas budget. SimulateTransaction returns this with INVALID_ARGUMENT. Gas selection runs only when do_gas_selection is set, checks is not DISABLED, and the transaction has no gas payment objects. When the server estimates the budget and the transaction fails in that estimation, SimulateTransaction returns TRANSACTION_EXECUTION_FAILED instead of this error, so with an estimated budget this reason means the transaction executed successfully in simulation.

Example of an ErrorInfo when the gas owner holds a single 2246360 MIST coin, has no address balance, and the transaction needs a budget of 8924024 MIST:

{ "reason": "INSUFFICIENT_GAS_BALANCE",
   "domain": "sui.io",
   "metadata": {
     "owner": "0x0000000000000000000000000000000000000000000000000000000000000123",
     "requiredBudget": "8924024",
     "coinBalance": "2246360",
     "addressBalance": "0"
   }
}

Metadata, with amounts in MIST as decimal strings:

  • owner: the gas owner’s address, as “0x” followed by 64 hex digits.
  • requiredBudget: the gas budget the transaction needs. When the request leaves the budget unset, this is the server’s estimate plus the cost of loading every coin counted in coinBalance beyond the first; otherwise it is the budget from the request. An estimated requiredBudget depends on how many coins the gas owner holds: when the owner already holds coins, sending it a new coin raises requiredBudget by up to the cost of loading one more coin. A new coin worth requiredBudget covers that increase unless coinBalance is less than the cost of loading one coin; a new coin worth only requiredBudget minus coinBalance can fall short.
  • coinBalance: total of the gas owner’s Coin<SUI> objects considered by gas selection: owned, non-consensus coins not already used as transaction inputs, largest first, up to the protocol’s maximum number of gas payment objects.
  • addressBalance: the gas owner’s SUI address balance remaining after the transaction’s own explicit SUI withdrawals from the gas owner; “0” if there is none.

The two balances are reported separately because they combine differently. When the transaction uses the gas coin (an Argument of kind GAS), coins and address balance are combined to pay for gas. Otherwise they are never combined: the address balance pays for gas only if it alone covers the budget before coin-loading costs, which is at most requiredBudget; if it does not, the coins alone must cover requiredBudget.

§

TransactionExecutionFailed = 4

The transaction failed while executing in simulation. SimulateTransaction returns this with INVALID_ARGUMENT when it estimates the budget, the transaction fails in that estimation, and gas selection then cannot cover the budget. It is returned instead of the INSUFFICIENT_GAS_BALANCE reason in that case because the transaction fails even with its gas paid for, so the gas budget is not what stops it; kind says what does. Some kinds can still be fixed by adding funds: for example, INSUFFICIENT_FUNDS_FOR_WITHDRAW means a balance the transaction withdraws from holds too little. INSUFFICIENT_GAS cannot: the estimation runs with the maximum gas budget, so it means the transaction needs more gas than any budget allows. A gas owner that can cover the budget instead gets a successful response whose effects.status.error describes the failure.

The status details also carry the ExecutionError, in the same form as effects.status.error.

Example of an ErrorInfo for a Move abort in the first command:

{ "reason": "TRANSACTION_EXECUTION_FAILED",
   "domain": "sui.io",
   "metadata": {
     "kind": "MOVE_ABORT",
     "command": "0"
   }
}

Metadata:

  • kind: the failure’s ExecutionError.ExecutionErrorKind name.
  • command: index of the command that failed, as a decimal string, or “” if no single command failed.
§

AboveLatestAvailable = 5

The request reads ledger data above what this server has indexed. The LedgerService ListCheckpoints, ListTransactions and ListEvents RPCs return this with OUT_OF_RANGE for a descending query when its end_checkpoint, which is exclusive, is above firstUnavailableCheckpoint; when, with end_checkpoint unset, its start_checkpoint is at or above firstUnavailableCheckpoint; or when its range reaches the latest indexed checkpoint (end_checkpoint unset or above firstUnavailableCheckpoint) and its before or after cursor names a position this server has not indexed. An ascending query never gets this error for its cursors or checkpoint range. Its range ends at the latest indexed checkpoint, and when the range reaches it, an after cursor past it ends an empty response with LEDGER_TIP at the position that cursor resumes from.

Such a cursor comes from a newer view of the ledger than this server’s, for example from another replica behind the same load balancer. The data is not indexed here yet, so the same request becomes servable once this server catches up, and a client may resend it unchanged after a delay. A cursor comes from a server that had indexed its position, so a request rejected for its cursor (bound is “cursor”) is servable within the time replicas take to catch up with each other. Any other bound names a checkpoint the caller chose, which the chain may not have reached.

Requests pinned to a checkpoint by at_checkpoint return this with OUT_OF_RANGE when that checkpoint is above the latest indexed checkpoint.

BatchGetObjects reports it only for the item with that at_checkpoint.

ListPackageVersions follows these rules for its checkpoint range and cursors; see ListPackageVersionsRequest.options. When it refuses a cursor for the version the cursor names, requestedCheckpoint is firstUnavailableCheckpoint; for a cursor from the listing of every package, it is the publish checkpoint the cursor names.

ListObjectVersions follows these rules for its checkpoint range and cursors; see ListObjectVersionsRequest.

Example of an ErrorInfo for a descending query’s before cursor at checkpoint 1205, sent to a server whose latest indexed checkpoint is 1199:

{ "reason": "ABOVE_LATEST_AVAILABLE",
   "domain": "sui.io",
   "metadata": {
     "bound": "cursor",
     "requestedCheckpoint": "1205",
     "firstUnavailableCheckpoint": "1200"
   }
}

Metadata, with checkpoints as decimal strings:

  • bound: what reads above the indexed data: “cursor” for a before or after cursor, or the name of the request field, such as “start_checkpoint”, “end_checkpoint” or “at_checkpoint”.
  • requestedCheckpoint: the checkpoint recorded in the cursor, or the value of the request field. For a ListObjectVersions cursor refused by its version, it is firstUnavailableCheckpoint; for ListObjectVersions cursors refused by the checkpoints they record, it is the lowest of those checkpoints.
  • firstUnavailableCheckpoint: the lowest checkpoint this server has not indexed, one above its latest indexed checkpoint, or “0” if it has indexed none.
§

BelowEarliestAvailable = 6

The request needs ledger data this server has pruned. The LedgerService ListCheckpoints, ListTransactions and ListEvents RPCs return this with OUT_OF_RANGE when the start of their scan, set by start_checkpoint or an after cursor, whichever is later, is below the lowest checkpoint this server serves; when a request with neither has a non-empty checkpoint range that ends at or below that checkpoint, or a before cursor at or below it; when a descending query with no lower bound of its own reaches it; or when the server prunes data a query has not read yet. A descending query that reaches the lowest checkpoint fails after it streams every item at or above that checkpoint, and its last response carries a watermark at that checkpoint.

GetCheckpoint, GetTransaction and BatchGetTransactions (for each item) return this with OUT_OF_RANGE for a checkpoint, or a transaction in a checkpoint, that the server can place below the lowest checkpoint it serves; see their request docs. So do point reads whose request docs say so.

Requests pinned to a checkpoint by at_checkpoint return this with OUT_OF_RANGE when that checkpoint is below the lowest checkpoint this server serves.

BatchGetObjects reports it only for the item with that at_checkpoint.

GetPackage also returns this with OUT_OF_RANGE for a version this server has pruned.

ListPackageVersions also returns this with OUT_OF_RANGE on servers that prune history; see ListPackageVersionsRequest. Its lowestAvailableCheckpoint is the lowest start_checkpoint it accepts.

ListObjectVersions returns this with OUT_OF_RANGE on servers that prune history; see ListObjectVersionsRequest. Its lowestAvailableCheckpoint is the lowest start_checkpoint the server accepts.

Pruned data does not come back, so the same request fails the same way on this server. A client can send it to a server that retains the data, or resume at or above lowestAvailableCheckpoint.

Example of an ErrorInfo from a server whose lowest available checkpoint is 5000:

{ "reason": "BELOW_EARLIEST_AVAILABLE",
   "domain": "sui.io",
   "metadata": {
     "lowestAvailableCheckpoint": "5000"
   }
}

Metadata, as decimal strings:

  • lowestAvailableCheckpoint: the lowest checkpoint this server serves.
§

ObjectRemoved = 7

The object was deleted or wrapped at the version a GetObject request, or a BatchGetObjects item, resolved to (see GetObjectRequest). Reported with NOT_FOUND. Best effort: a server that cannot find the removal, for example because it pruned it or keeps no record of removals, answers NOT_FOUND without this reason, so its absence does not mean the object never existed. A removal written after the request’s at_checkpoint is not visible to it. The object can come back at a higher version, by an unwrap or by being created again under the same ID; the error describes only the version the request resolved to. To find the transaction that removed it, call ListObjectVersions with start_version set to removedVersion, end_version one above it, and transaction in removal_read_mask.

Example of an ErrorInfo for an object deleted at version 42:

{ "reason": "OBJECT_REMOVED",
   "domain": "sui.io",
   "metadata": {
     "removedVersion": "42",
     "removalKind": "DELETED"
   }
}

Metadata:

  • removedVersion: the removal’s version, as a decimal string.
  • removalKind: DELETED or WRAPPED, an ObjectRemoval.Kind name.
§

NotServedHere = 8

This server is not set up for the method, or for this kind of request on a method it otherwise serves, for example a read at a checkpoint (GetObject with at_checkpoint) on a server without RPC indexes. Returned with UNIMPLEMENTED. The same request to the same server always fails the same way: do not retry it there, send it to a server configured to serve it. UNIMPLEMENTED without this reason comes from a server that lacks the method, predates this reason, or does not attach it.

Example of an ErrorInfo from a server without RPC indexes:

{ "reason": "NOT_SERVED_HERE",
   "domain": "sui.io",
   "metadata": {
     "cause": "no_rpc_indexes"
   }
}

Metadata:

  • cause: what this server lacks: “no_rpc_indexes” (it does not keep the RPC indexes the request needs) or “disabled_by_config” (its configuration turns the method or this kind of request off).
§

NotReady = 9

This server cannot serve the request now but will be able to, for example while it starts or backfills history. Returned with UNAVAILABLE. Retry, preferably on another replica.

Example of an ErrorInfo from a server backfilling history restored from a snapshot:

{ "reason": "NOT_READY",
   "domain": "sui.io",
   "metadata": {
     "cause": "restore_backfill"
   }
}

Metadata:

  • cause: the temporary state that stops the server, such as “index_empty” (its index holds no data yet), “restore_backfill” (it is backfilling history restored from a snapshot) or “history_catching_up” (its indexes trail its live state). More causes may be added.
§

VersionNotRetained = 10

The request needs an older version of an object that this server no longer holds: the server keeps only the latest version of each object, and a newer version has replaced the one requested. Returned with OUT_OF_RANGE, for example by GetObject with a version below the object’s latest version and no at_checkpoint.

The server has no checkpoint below which data is gone, so the error carries no lowestAvailableCheckpoint. The version does not come back, so the same request fails the same way on this server. A server that keeps every version of each object, such as kv-rpc, may serve it.

Example of an ErrorInfo for GetObject with version 5 of an object whose latest version on this server is 8:

{ "reason": "VERSION_NOT_RETAINED",
   "domain": "sui.io"
}

It carries no metadata.

Implementations§

§

impl ErrorReason

pub fn is_valid(value: i32) -> bool

Returns true if value is a variant of ErrorReason.

pub fn from_i32(value: i32) -> Option<ErrorReason>

👎Deprecated:

Use the TryFrom<i32> implementation instead

Converts an i32 to a ErrorReason, or None if value is not a valid variant.

§

impl ErrorReason

pub fn as_str_name(&self) -> &'static str

String value of the enum field names used in the ProtoBuf definition.

The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.

pub fn from_str_name(value: &str) -> Option<ErrorReason>

Creates an enum from field names used in the ProtoBuf definition.

§

impl ErrorReason

pub const DOMAIN: &'static str = "sui.io"

The error domain of every ErrorReason, used as google.rpc.ErrorInfo.domain.

Trait Implementations§

§

impl AsRef<str> for ErrorReason

§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
§

impl Clone for ErrorReason

§

fn clone(&self) -> ErrorReason

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Copy for ErrorReason

§

impl Debug for ErrorReason

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for ErrorReason

§

fn default() -> ErrorReason

Returns the “default value” for a type. Read more
§

impl<'de> Deserialize<'de> for ErrorReason

§

fn deserialize<D>( deserializer: D, ) -> Result<ErrorReason, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Eq for ErrorReason

§

impl From<ErrorReason> for i32

§

fn from(value: ErrorReason) -> i32

Converts to this type from the input type.
§

impl Hash for ErrorReason

§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl Ord for ErrorReason

§

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

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

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

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

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

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

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

Restrict a value to a certain interval. Read more
§

impl PartialEq for ErrorReason

§

fn eq(&self, other: &ErrorReason) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for ErrorReason

§

fn partial_cmp(&self, other: &ErrorReason) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

impl Serialize for ErrorReason

§

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl StructuralPartialEq for ErrorReason

§

impl TryFrom<i32> for ErrorReason

§

type Error = UnknownEnumValue

The type returned in the event of a conversion error.
§

fn try_from(value: i32) -> Result<ErrorReason, UnknownEnumValue>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

§

impl<U> As for U

§

fn as_<T>(self) -> T
where T: CastFrom<U>, U: Sized,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CallHasher for T
where T: Hash + ?Sized,

§

fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64
where H: Hash + ?Sized, B: BuildHasher,

§

impl<T> Clear for T
where T: InitializableFromZeroed + ?Sized,

§

fn clear(&mut self)

Completely overwrites this value.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<T> Conv for T

§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> FmtForward for T

§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<'de, T> FromBcs for T
where T: Deserialize<'de>,

§

fn from_bcs<'de>(bytes: &'de [u8]) -> Result<Self, Error>
where Self: Deserialize<'de>,

§

fn from_bcs_base64(base64: &str) -> Result<Self, Error>
where Self: DeserializeOwned,

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> InitializableFromZeroed for T
where T: Default,

§

unsafe fn initialize(place: *mut T)

Called to initialize a place to a valid value, after it is set to all-bits-zero. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a Request
§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<I> IntoResettable<String> for I
where I: Into<String>,

§

fn into_resettable(self) -> Resettable<String>

Convert to the intended resettable type
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
§

impl<T> MaybeSendSync for T

Source§

impl<N> NodeTrait for N
where N: Copy + Ord + Hash,

§

impl<T> Pipe for T
where T: ?Sized,

§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T> Sequence for T
where T: Eq + Hash,

Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>

§

impl<T> ServiceExt for T

§

fn propagate_header(self, header: HeaderName) -> PropagateHeader<Self>
where Self: Sized,

Propagate a header from the request to the response. Read more
§

fn add_extension<T>(self, value: T) -> AddExtension<Self, T>
where Self: Sized,

Add some shareable value to request extensions. Read more
§

fn map_request_body<F>(self, f: F) -> MapRequestBody<Self, F>
where Self: Sized,

Apply a transformation to the request body. Read more
§

fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>
where Self: Sized,

Apply a transformation to the response body. Read more
§

fn compression(self) -> Compression<Self>
where Self: Sized,

Compresses response bodies. Read more
§

fn decompression(self) -> Decompression<Self>
where Self: Sized,

Decompress response bodies. Read more
§

fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using HTTP status codes. Read more
§

fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using gRPC headers. Read more
§

fn follow_redirects(self) -> FollowRedirect<Self>
where Self: Sized,

Follow redirect resposes using the Standard policy. Read more
§

fn sensitive_headers( self, headers: impl IntoIterator<Item = HeaderName>, ) -> SetSensitiveRequestHeaders<SetSensitiveResponseHeaders<Self>>
where Self: Sized,

Mark headers as sensitive on both requests and responses. Read more
§

fn sensitive_request_headers( self, headers: impl IntoIterator<Item = HeaderName>, ) -> SetSensitiveRequestHeaders<Self>
where Self: Sized,

Mark headers as sensitive on requests. Read more
§

fn sensitive_response_headers( self, headers: impl IntoIterator<Item = HeaderName>, ) -> SetSensitiveResponseHeaders<Self>
where Self: Sized,

Mark headers as sensitive on responses. Read more
§

fn override_request_header<M>( self, header_name: HeaderName, make: M, ) -> SetRequestHeader<Self, M>
where Self: Sized,

Insert a header into the request. Read more
§

fn append_request_header<M>( self, header_name: HeaderName, make: M, ) -> SetRequestHeader<Self, M>
where Self: Sized,

Append a header into the request. Read more
§

fn insert_request_header_if_not_present<M>( self, header_name: HeaderName, make: M, ) -> SetRequestHeader<Self, M>
where Self: Sized,

Insert a header into the request, if the header is not already present. Read more
§

fn override_response_header<M>( self, header_name: HeaderName, make: M, ) -> SetResponseHeader<Self, M>
where Self: Sized,

Insert a header into the response. Read more
§

fn append_response_header<M>( self, header_name: HeaderName, make: M, ) -> SetResponseHeader<Self, M>
where Self: Sized,

Append a header into the response. Read more
§

fn insert_response_header_if_not_present<M>( self, header_name: HeaderName, make: M, ) -> SetResponseHeader<Self, M>
where Self: Sized,

Insert a header into the response, if the header is not already present. Read more
§

fn set_request_id<M>( self, header_name: HeaderName, make_request_id: M, ) -> SetRequestId<Self, M>
where Self: Sized, M: MakeRequestId,

Add request id header and extension. Read more
§

fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>
where Self: Sized, M: MakeRequestId,

Add request id header and extension, using x-request-id as the header name. Read more
§

fn propagate_request_id( self, header_name: HeaderName, ) -> PropagateRequestId<Self>
where Self: Sized,

Propgate request ids from requests to responses. Read more
§

fn propagate_x_request_id(self) -> PropagateRequestId<Self>
where Self: Sized,

Propgate request ids from requests to responses, using x-request-id as the header name. Read more
§

fn catch_panic(self) -> CatchPanic<Self, DefaultResponseForPanic>
where Self: Sized,

Catch panics and convert them into 500 Internal Server responses. Read more
§

fn request_body_limit(self, limit: usize) -> RequestBodyLimit<Self>
where Self: Sized,

Intercept requests with over-sized payloads and convert them into 413 Payload Too Large responses. Read more
§

fn trim_trailing_slash(self) -> NormalizePath<Self>
where Self: Sized,

Remove trailing slashes from paths. Read more
§

fn append_trailing_slash(self) -> NormalizePath<Self>
where Self: Sized,

Append trailing slash to paths. Read more
§

impl<T> Tap for T

§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
§

impl<T> ToAst for T

§

fn ast(self, begin: usize, end: usize) -> Spanned<Self>

§

impl<T> ToBcs for T
where T: Serialize,

§

fn to_bcs(&self) -> Result<Vec<u8>, Error>

§

fn to_bcs_base64(&self) -> Result<String, Error>

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more