Skip to main content

Language

Struct Language 

Source
pub struct Language(/* private fields */);
Available on crate feature derive only.
Expand description

A primary language subtag, in the shortest spelling BCP 47 has for it: de, zh, yue, und.

WIDE IN, STRICT OUT. What a container writes is dirty in four separate ways and each has a fold, none of which is a rule invented here — every one is a column of a vendored registry:

sentheldthe column that did it
DE, Dedenone — ASCII case is a spelling, not a value
ger (mkv, ISO 639-2/B)deregistry::alpha3
deu (mp4, ISO 639-2/T)dethe same, in ONE hop rather than through ger
iwheregistry::language_preferred

The two folds are applied in that order and each at most once, so GER reaches de and stops. See new.

§und is a VALUE, and it is not the absence of one

The registry registers und — Undetermined — like any other subtag, and this type holds it like any other value. A track whose language nobody recorded has NO language, which is a NULL column and an Option::None; a track a muxer explicitly tagged und has one, and it says the muxer looked and could not tell. Collapsing the two would lose the difference between nobody asked and somebody asked and did not know, and the second is the one that says a detector has work to do.

UND is how the value is named — an associated constant, which is what the ruling asked for. It shipped as a function first, and the reason was a fact about the dependency rather than a preference: smol_bytes::Utf8Bytes::from_static was not const in smol-bytes 0.1.3 — only Utf8Buffer‘s and RawBytes’ were — so no value of this type could be a const item at all. smol-bytes 0.1.4 made it const, and the constant took the shape it was always ruled to have.

One thing the fix did NOT restore: a const still cannot be a MATCH pattern here. Utf8Bytes is not structural-match, so match language { Language::UND => … } is not available whatever the constant’s constness — hence is_undetermined, which is the question a match arm was going to ask.

§A subtag the registry does not carry is ADMITTED

Structure and registration are two questions and this type only refuses on the first. xyz is three ASCII letters, which is a language subtag’s shape, so it is held — and is_registered is what says the registry has never heard of it.

Refusing it would be the worse bargain by some distance. The registry gains subtags, a vendored copy is a snapshot, and a container in the wild carries whatever its muxer believed: refusing would make a file unindexable because of a table this crate last fetched in August, where admitting it stores the tag, answers false to the one question that is actually about the registry, and lets everything else proceed.

The PRIVATE-USE range is the same posture with a name: qaa through qtz are reserved by the registry as a block and individually registered by nobody, so is_private_use is what tells a deliberate private tag apart from a typo. Both answer is_registered() == false, and only the first is intentional.

§Equality is the CANONICAL subtag, so the folds are what make it useful

Language::new("ger")? == Language::new("de")?, because both hold de. That is the whole point of folding at the door rather than at comparison time: an mkv’s German and an mp4’s German are one value, one IN list member, one index entry and one group — and nothing downstream has to know that ISO 639-2 has two alphabets.

It also means a stored column is canonical, which is what lets storage equality BE value equality: WHERE "language" = 'de' finds the row a ger tag produced.

§Ordering is ALPHABETICAL, and that is all it is

Ord is derived through the text, so de < en < fr. It orders the SPELLINGS and says nothing about the languages — zh sorts last of those four and is spoken by the most people — which is the same bargain any single-word vocabulary states for its sort order, and it earns its place for the same reason: total, stable, and therefore a usable cursor key. gt: "en" with an ORDER BY on the same column walks a table once with no row seen twice.

Implementations§

Source§

impl Language

Source

pub const UND: Self

The undetermined language, und — the value a muxer writes when it looked and could not tell.

An associated constant, as the ruling asked — smol_bytes::Utf8Bytes::from_static became const in smol-bytes 0.1.4, which is what let this item stop being the function it shipped as. It allocates nothing — the subtag is three bytes and rides Utf8Bytes’ inline representation.

Source

pub fn new(text: &str) -> Result<Self, ParseLanguageError>

Read a language subtag, WIDE — any case, and either ISO 639-2 alphabet.

The one door in. Every other route to a value of this type — FromStr, the GraphQL scalar, the column decode and the cursor — goes through here, so there is one grammar and one fold rather than one per entry point.

§The grammar, and it is checked BEFORE the registry

Two to eight ASCII letters, which is BCP 47’s language = 2*3ALPHA / 4ALPHA / 5*8ALPHA read as one range. Anything else is refused, and the refusal names which rule broke rather than reporting that the input was malformed — see ParseLanguageError.

The ALPHABET is tested before the LENGTH, which is not the order the rules are written in and is the order that gives the better sentence: 日本語 is 9 bytes, so a length-first check would refuse it for being too long when what is wrong with it is that a subtag is letters.

§The folds, in order, each at most once
  1. case — lower, which is the case the registry spells a language in.
  2. ISO 639-2 to the shortest spelling — registry::alpha3. ger and deu both answer de, directly rather than through each other, so this is one hop and not two.
  3. deprecated to preferred — registry::language_preferred. iw answers he. One hop is enough by construction: the generator refuses a table in which a preferred value itself prefers something else.

The second and third are applied in sequence rather than as alternatives, so a code that needed both would take both. None does today — every target of the alpha-3 fold is a current two-letter code — and the sequence is what keeps that a fact about the data rather than a premise of the code.

§Errors

ParseLanguageError, naming the rule that refused. Being unregistered is not one of them.

Source

pub fn is_undetermined(&self) -> bool

Is this the undetermined language?

The question a match arm would have asked if a value of this type could be a pattern. See the type docs, where what stands in the way is stated.

Source

pub fn as_str(&self) -> &str

The canonical subtag, as text.

Source

pub fn into_inner(self) -> Utf8Bytes

The canonical subtag, as the text seat this house carries.

Source

pub fn name(&self) -> Option<&'static str>

The registry’s own name for this language — German, Yue Chinese — or None where it registers no such subtag.

The FIRST description where the registry gives several: ro is Romanian, which the registry leads with, and not Moldavian or Moldovan, which it also lists. A name is a label for a person to read; the identity is the subtag.

Source

pub fn is_registered(&self) -> bool

Does the vendored registry carry this subtag?

false is not an error and never was — see the type docs. It is false for a private-use subtag too, which is_private_use is what distinguishes.

Source

pub fn is_deprecated(&self) -> bool

Has the registry deprecated this subtag?

A canonical value can still be deprecated, which is not a contradiction: 120 deprecated language subtags name no replacement, so the fold has nowhere to send them and they stay themselves. iw is never one of these — it prefers he, so a Language never holds it.

Source

pub fn is_private_use(&self) -> bool

Does this subtag fall in the range the registry reserves for private use, qaa to qtz?

What tells a deliberate private tag apart from a typo, both of which are unregistered.

Source

pub fn suppressed_script(&self) -> Option<&'static str>

The script this language implies, where the registry says it implies one.

Suppress-Script, and the reason it is published on the LANGUAGE rather than kept private to the composition that uses it: it is a fact about the language — English is written in Latin script — and a caller who wants to know why en-Latn composed as en reads it here.

None for zh, which is what keeps zh-Hans and zh-Hant two different identities.

Trait Implementations§

Source§

impl AsRef<str> for Language

Source§

fn as_ref(&self) -> &str

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

impl<'a, R: Row> Assemble<'a, R> for Language
where String: Assemble<'a, R>,

Available on crate feature sqlx only.

The decode — one TEXT column back through this type’s own door.

Generic over the ROW where the bind is generic over the DIALECT, which is the two traits’ parameters rather than a choice made here.

Source§

fn assemble(row: &'a R, under: Option<&Path<'_>>) -> Result<Self>

Read this value out of row, under the segments under names. Read more
Source§

impl<Db> Carrier<Db> for Language
where Db: Database, String: Carrier<Db>,

Available on crate feature sqlx only.

The bind: the canonical subtag as text.

An OWNED String rather than the borrowed &str the slot already holds, and the reason is sqlx::QueryBuilder’s own lifetime rather than a preference. push_bind requires its value to outlive the builder’s 'args, which this trait’s signature leaves unrelated to &self — so a borrow of self cannot satisfy it, and the copy is what a bind of borrowed text costs at this seat. It is at most eight bytes.

Source§

fn push_bind(&self, qb: &mut QueryBuilder<Db>)

Push this value’s placeholder and bound argument onto qb. Read more
Source§

fn push_value_bind(&self, qb: &mut QueryBuilder<Db>)

Push this value’s placeholders and bound arguments for its VALUE columns alone — the DERIVED leaves left out. Read more
Source§

impl Clone for Language

Source§

fn clone(&self) -> Self

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
Source§

impl ColumnEq for Language

A subtag is the same as a subtag when its canonical text is — one column, one comparison.

Source§

fn column_eq(&self, other: &Self) -> bool

Whether self and other are the same stored value.
Source§

impl ColumnKind for Language

ONE column, which is the default — stated rather than inherited, because a reader auditing this house against [LanguageId]’s four columns should find the answer here rather than the absence of one.

Source§

const SEGMENTS: &'static [ColumnShape] = _

What this type spans beneath the field that names it. Read more
Source§

const ORDER: &'static [OrderLevel] = _

WHICH ORDER those columns mean — the leaves an order over this type sorts by, in sequence. Read more
Source§

impl CompositeFilterMarker for Language

What guards a Language column, and it is the same predicate at both host kinds.

A subtag stores every field it declares — there is only the one — so the two seats name one predicate: ScalarFilter under the reading this crate declares.

Source§

type Filter = ScalarFilter<Language, LanguageWire>

The filter a composite column of this type gets at a ROWLESS host — the full field set.
Source§

type ColumnFilter = ScalarFilter<Language, LanguageWire>

The filter a composite column of this type gets at a ROW-HOLDING host — the stored subset.
Source§

impl CursorValue for Language

The KEYSET position: the canonical subtag’s UTF-8 bytes, which is what Utf8Bytes’ own row writes and therefore what a column declared as either pages past.

The read RE-VALIDATES, because a cursor is a string a CLIENT hands back — so a forged position is refused rather than turned into a value whose type says it cannot exist.

Source§

fn write_cursor(&self, out: &mut Vec<u8>)

Append this value’s cursor bytes to out.
Source§

fn read_cursor(bytes: &[u8]) -> Option<Self>

The value bytes holds, or None where they are not this type’s encoding. Read more
Source§

impl Debug for Language

Written out rather than derived, so an assertion message reads Language("de") rather than the Utf8Bytes representation’s own three-field shape.

Source§

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

Formats the value using the given formatter. Read more
Source§

impl DeclaredLeaves for Language

One leaf, and it is the value — ONE column, so there is no sequence to permute.

Source§

impl DefaultMarker for Language

The interpretation a Language field is read under: the framework’s COMPOSITE reading, which is the VALUE family’s member for one value occupying a column of its own.

This crate used to MINT the marker here — a local marker type with its own Marker row — because none of the framework’s family words named this filter, the filter being ScalarFilter under a reading this crate declares. CompositeMarker is the family that was missing, and the row above is the answer the mint existed to supply.

Its Marker::UnderOption is NullableMarker and not the collection reading: a subtag occupies a column OF ITS OWN, so it can be NULL and the null state is a real observable — a track whose language nobody recorded is not a track whose language is und.

Source§

type Marker = CompositeMarker<Language>

The interpretation this type is read under by default.
Source§

impl DelegatesId for Language

THE KEY ROW: this subtag stands at a key position — a record’s #[ingraph(id)], an aggregate’s #[ingraph(group)] — as the Utf8Bytes it holds.

Id is SEALED, so impl Id is not a road for a named type even in this crate: its members are admitted by MEASUREMENT, and the one door beside that is the transparency assertion below. Utf8Bytes is a measured member — text, with the filesystem escape a text segment takes — and this type is that text under a grammar.

§The obligation, checked against what this type actually WRITES

The assertion is that every id duty reading a Language reads its Utf8Bytes, and the three duties are the segment, the identity and the order:

  • The filesystem segment is store::fs‘s delegation row, which renders the delegate — so a subtag addresses exactly the file its text addresses. There is no second rendering anywhere in this house to disagree with it: CursorValue::write_cursor above writes self.as_str().as_bytes(), which is byte for byte what Utf8Bytes’ own cursor row writes, and Carrier::push_bind binds self.as_str() as text.
  • The identity is the derived PartialEq/Eq/ Hash, each of which reads the one field and nothing else — two subtags are equal exactly when their Utf8Bytes are.
  • The order is the derived Ord, through the same field, which is the alphabetical order the type documents.

And the type carries NO second field, tag or width: it is a #[repr(Rust)] newtype over one Utf8Bytes.

§The FOLD is the door’s, and it strengthens this rather than qualifying it

ger, GER and de are ONE value here, because the fold happens once at construction and the value that exists afterwards holds de. So the delegate is the FOLDED text, and two spellings of one identity address one file, key one row and walk one position — which is what a key needs and what a type folding at comparison time could not give it.

SAFETY: this type is a newtype holding one Utf8Bytes and nothing else — no second field, no tag, no width of its own. Its equality, hash and order are all derived through that one field, so two values are equal exactly when their delegates are; delegate is a field borrow, so it is pure and answers the same inner every time; and every id duty that reads one reads that text, the segment through the framework’s own delegation row and nothing else through anything.

Source§

type Inner = Utf8Bytes<Shared>

The id this type IS, wearing its own name. Read more
Source§

fn delegate(&self) -> &Utf8Bytes

The delegate: the inner value every id duty reads in place of self. Read more
Source§

impl Display for Language

The canonical subtag, and nothing else — no quotes, no wrapper, no type name.

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for Language

Source§

impl From<Language> for LanguageId

A tag with no other seats filled — the shape a bare language subtag composes to.

Source§

fn from(language: Language) -> Self

Converts to this type from the input type.
Source§

impl From<Language> for Utf8Bytes

Source§

fn from(subtag: Language) -> Self

Converts to this type from the input type.
Source§

impl From<Language> for String

What gives String: TryFrom<[$subtag]( Language )> through std’s blanket, which is the crossing a storage comparison over a TEXT column makes — and it makes it with Error = Infallible, a canonical subtag being valid text by construction.

Source§

fn from(subtag: Language) -> Self

Converts to this type from the input type.
Source§

impl FromStr for Language

Source§

fn from_str(text: &str) -> Result<Self, Self::Err>

The type’s own door — see its new, where the grammar and the folds are.

Source§

type Err = ParseLanguageError

The associated error which can be returned from parsing.
Source§

impl Hash for Language

Source§

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

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
Source§

impl InputType for Language

Available on crate feature async-graphql only.
Source§

type RawValueType = Language

The raw type used for validator. Read more
Source§

fn type_name() -> Cow<'static, str>

Type the name.
Source§

fn create_type_info(registry: &mut Registry) -> String

Create type information in the registry and return qualified typename.
Source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

Parse from Value. None represents undefined.
Source§

fn to_value(&self) -> Value

Convert to a Value for introspection.
Source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

Returns a reference to the raw value.
Source§

fn qualified_type_name() -> String

Qualified typename.
Source§

impl MongoCarrier for Language

Available on crate feature mongo only.

THE DOCUMENT’S FORM: a BSON String holding the canonical subtag — the same text the TEXT column above binds, at the one BSON type that holds it.

A subtag is ONE WORD, so there is nothing here of [LanguageId]’s composite question: no sub-document, no key set, no field order. What the row states is that the two families store one value — a de row written by SQLite and a de document written by MongoDB carry the same eight bytes at most — which is what lets one canonicalisation serve both.

BSON’s String order is bytewise over UTF-8, so $gt and $lt over such a field walk the same alphabetical order the type’s derived Ord walks and the cursor above writes. That is read from MongoDB’s documented BSON order rather than measured against a live server here, which is the posture the register takes for its BinData rows.

§What a DOCUMENT can hold is the narrower question, and the answer is Timestamp’s

This row is the FILTER OPERAND’s. The document’s WRITE is serde’s, and no storage type this crate ships carries a serde row — so a declaration naming a bare Language column under mongo(…) is E0277 at the declaration, and the escape is the one Timestamp’s row names: a type = "…" with its own conversions, which for a subtag is the String it already converts to and from.

Source§

fn to_bson(&self) -> Bson

This value as the BSON this crate stores it as.
Source§

impl MongoExtract for Language

Available on crate feature mongo only.

THE READ: the same canonical word, back through the door — [MongoCarrier]’s mirror, row for row the way query::mongo’s own carrier and extract tables are.

A string field is exactly as untrusted as the TEXT column Assemble above reads: nothing stops a document holding !!!, one written before a registry bump, or one written by hand for a test. So the read goes through Language::new rather than wrapping the bytes, which is what makes it CANONICALISE rather than merely validate — a document holding GER reads back as de, the value the SQL decode’s own re-validation produces from the same three letters. See the macro’s own doc for the shape of what the refusal carries and does not.

Source§

const BSON: &'static str = "string"

The BSON type ALIAS this row reads — $type’s own word, so a refusal and a query that would find the offending documents spell the type the same way.
Source§

fn extract(value: Option<&Bson>) -> Result<Self, MongoTypeError>

This value, out of the BSON a document held at some field, or None where the field is absent. Read more
Source§

impl Ord for Language

Source§

fn cmp(&self, other: &Self) -> 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
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl OutputType for Language

Available on crate feature async-graphql only.
Source§

fn type_name() -> Cow<'static, str>

Type the name.
Source§

fn create_type_info(registry: &mut Registry) -> String

Create type information in the registry and return qualified typename.
Source§

async fn resolve( &self, _: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>

Available on non-crate feature boxed-trait only.
Resolve an output value to async_graphql::Value.
Source§

fn qualified_type_name() -> String

Qualified typename.
Source§

fn introspection_type_name(&self) -> Cow<'static, str>

Introspection type name Read more
Source§

impl PartialEq for Language

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl PartialOrd for Language

Source§

fn partial_cmp(&self, other: &Self) -> 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
Source§

impl ScalarType for Language

Available on crate feature async-graphql only.

A BCP 47 primary language subtag, read WIDE and written back canonical: "de", "DE", "ger" (an mkv’s ISO 639-2/B) and "deu" (an mp4’s 639-2/T) are one operand, and it is written back as de.

"iw" is he, "in" is id — the registry’s Preferred-Value column, applied at the door.

"und" is an ordinary value meaning undetermined, and it is NOT the way to say a track has no language: an absent language is null, and the difference is between a muxer that looked and could not tell and a muxer that never looked.

A subtag the registry does not carry is ACCEPTED — the structure is what is checked here, and a vendored registry is a snapshot. What is refused is a string that is not a subtag’s SHAPE: zh_CN for its underscore, e for its length, 日本語 for its characters.

Source§

fn is_valid(value: &Value) -> bool

The SOLE notion of validity, shared with parse so that a query which validates is a query which parses. async-graphql’s default answers true for every value, so a scalar narrowing in parse alone ships a validator admitting what its own parser rejects — and the refusal then lands at execution rather than at validation, where a client is looking.

What sharing it costs is the SENTENCE: validation runs before any resolver and reads a bool, so a client sending a bad operand is told the type its value could not become and not which rule it broke. The ParseLanguageError sentences are what a caller holding a value gets.

Source§

fn to_value(&self) -> Value

STRICT OUT: the canonical subtag, whichever spelling came in.

Source§

fn parse(value: Value) -> InputValueResult<Self>

Parse a scalar value.
Source§

impl ScalarWire<Language> for LanguageWire

Source§

const NAME: &'static str = "LanguageFilter"

The GraphQL input object a scalar filter over T under this reading is published as.
Source§

type Carrier = Language

The wire type ONE operand crosses on. Read more
Source§

type Error = !

What a refused crossing says. Infallible where a crossing cannot refuse.
Source§

fn cross(carrier: Self::Carrier) -> Result<Language, Self::Error>

One operand, read off the wire. Read more
Source§

fn carry(operand: &Language) -> Self::Carrier

One operand, written back onto the wire. Read more
Source§

impl<Db> StoredAs<Db> for Language
where String: StoredAs<Db>,

The DECLARATION: whatever this dialect calls text, since the bind below is a String.

The word is delegated rather than named for the reason the bind is: a subtag IS its canonical text, so the column is a text column and the dialect’s own word for one is the only answer. The delegation carries the ADMISSION with it — a subtag is declarable exactly where text is, which is everywhere.

Source§

const WORDS: &'static [&'static str]

One word per column this type spans, in SEGMENTS order, written in this dialect catalogue’s own reported spelling.
Source§

impl StructuralPartialEq for Language

Source§

impl ToGraphqlInput for Language

The crossing is the IDENTITY: this type is its own GraphQL scalar, so an operand needs no second spelling. Every refusal happens at that scalar’s door, which is the one route a wire value takes in.

Source§

type Input = Language

The wire type one operand of this type crosses on. Read more
Source§

type Error = !

What a refused crossing says. Infallible where a crossing cannot refuse.
Source§

fn cross(input: Self::Input) -> Result<Self, Self::Error>

One operand, read off the wire. Read more
Source§

fn carry(operand: &Self) -> Self::Input

One operand, written back onto the wire. Read more
Source§

impl ToGraphqlOutput for Language

The crossing OUT, and it is the identity the crossing IN is: this type IS its own GraphQL scalar, so what a wire face returns is a BORROW of the value the row already holds.

The row above says what a client may SEND and this one what a client is GIVEN, and the pair is what makes a subtag column a whole field type rather than half of one — a filter face with no return is what ToGraphqlOutput’s own note calls half a field type. An emitted record’s face returns < Language as ToGraphqlOutput>::Output<'_>, so a declaration storing one could publish NOTHING without this row: E0277 at the emitted face, naming the member.

&'a Self and never a clone, which is String’s own row’s bargain: the scalar door’s to_value is what builds the JSON, and it takes a borrow.

The seat is BARE — no OutputType bound is written here — so the row stands in a build with no GraphQL binding at all, and the library that renders it demands what it needs where it spends the form. That is the map’s own law rather than a choice made in this house.

Source§

type Output<'a> = &'a Language

The form a value of M crosses into an OUTPUT position as.
Source§

fn to_graphql_output(marked: &Self) -> &Self

That value, in that form. Read more

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
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
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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
Source§

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

Source§

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

Compare self to key and return their ordering.
Source§

impl<T> Conv for T

Source§

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

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

impl<Db, T> DialectCursor<Db> for T
where T: CursorValue,

Source§

fn write_cursor_at(&self, out: &mut Vec<u8>)

Append this value’s cursor bytes for Db to out.
Source§

fn read_cursor_at(bytes: &[u8]) -> Option<T>

The value bytes holds at Db, or None where they are not this dialect’s encoding. Read more
Source§

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

Source§

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

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

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

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

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

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

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

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
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.
Source§

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

Source§

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

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

impl<T> FmtForward for T

Source§

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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.

Source§

impl<T> Fruit for T
where T: Send + Downcast,

Source§

impl<T> Id for T
where T: DelegatesId, <T as DelegatesId>::Inner: Id,

Source§

impl<T> Instrument for T

Source§

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

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

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
Source§

impl<T> OrderLeaves for T

Source§

type Leaf = T

The value ONE of this type’s order levels compares. Read more
Source§

fn leaf(&self, _: usize) -> Option<T>

The at-th LEAF’s value, or None where this value has none there. Read more
Source§

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

Source§

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
Source§

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
Source§

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
Source§

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
Source§

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
Source§

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.
Source§

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.
Source§

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.
Source§

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.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<K> PositionKey for K
where K: Clone + Eq + Hash + Send + Sync,

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> RootKey for T
where T: Clone + Eq + Hash + Send + Sync + 'static,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SearchOptionsFace for T
where T: InputType,

Source§

impl<T> Searchable for T
where T: AsRef<str> + ?Sized,

Source§

fn write(&self, into: &mut BoxWriter)

Push this value into into as ONE segment.
Source§

impl<I> Segment for I
where I: Id + Render,

Source§

impl<T> State<Identity> for T

Source§

type Output = T

The type Self projects to.
Source§

impl<T> Tap for T

Source§

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

Immutable access to a value. Read more
Source§

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

Mutable access to a value. Read more
Source§

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
Source§

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
Source§

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
Source§

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
Source§

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
Source§

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
Source§

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

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

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

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

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.
Source§

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.
Source§

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.
Source§

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.
Source§

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.
Source§

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.
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
Source§

impl<T> ToSmolStr for T
where T: Display + ?Sized,

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> TryConv for T

Source§

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WireScore for T
where T: ToGraphqlOutput + Send + Sync + 'static, <T as ToGraphqlOutput>::Output<'a>: for<'a> OutputType,

Source§

type Wire<'a> = <T as ToGraphqlOutput>::Output<'a> where T: 'a

Available on crate feature async-graphql only.
The form this score crosses into, and it is OutputType — the BACKEND’s demand, made where the backend spends the form.
Source§

fn wire_score(&self) -> <T as WireScore>::Wire<'_>

Available on crate feature async-graphql only.
This score, in that form.
Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

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