Skip to main content

DefaultMarker

Trait DefaultMarker 

Source
pub trait DefaultMarker {
    type Marker: ToGraphqlFilter + Marker<Marked = Self>;
}
Expand description

The marker a field’s type carries when the declaration names none.

This is the INFERENCE, and it is what keeps the common case free of annotation: an expansion projects a domain type through here, so a field whose type has one sensible reading is declared exactly as it was before markers existed.

The associated type carries ToGraphqlFilter as an item bound so that a registration naming a marker nothing answers for fails AT the registration, rather than at the first declaration that happens to use the type. It is also the one place this module names the GraphQL axis — see the module note, where dropping the bound is measured: the crate still compiles and the compile_fail example below stops failing.

It carries Marker<Marked = Self> beside it, which is a LAW and not only a bound: the marker a type defaults to must be an interpretation OF THAT TYPE. Nothing said so before, and type Marker = ScalarMarker<SomethingElse> was a well-formed row.

Saying it is what makes a composed marker’s default checkable. NullableMarker<Option<T>> resolves its inner half to <T as DefaultMarker>::Marker and then has to prove that half marks T — which for an abstract T is provable only from the item bound. Without it the equality is an opaque projection and the blanket over Option<T> is E0271, measured on the way in.

That is what keeps the two halves of a registration from drifting. type Marker = StringMarker<Reel> is well formed only while Reel: StringFilterMarker, so a row whose family impl says one thing and whose default says another is E0277 on the line that wrote it — measured, and pinned by the compile_fail example below.

ⓘ
struct Reel;

impl ingraph::ScalarFilterMarker for Reel {
  type Filter = ingraph::ScalarFilter<Reel>;
}

// The halves disagree: `Reel` answers the scalar family and the default names the string one.
impl ingraph::DefaultMarker for Reel {
  type Marker = ingraph::StringMarker<Reel>;
}

Required Associated Types§

Source

type Marker: ToGraphqlFilter + Marker<Marked = Self>

The interpretation this type is read under by default.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl DefaultMarker for Bytes

Source§

impl DefaultMarker for Bytes

Source§

impl DefaultMarker for Date

Source§

impl DefaultMarker for DateTime

Source§

impl DefaultMarker for IpAddr

Source§

impl DefaultMarker for Ipv4Addr

Source§

impl DefaultMarker for Ipv6Addr

Source§

impl DefaultMarker for NonZeroI8

Source§

impl DefaultMarker for NonZeroI16

Source§

impl DefaultMarker for NonZeroI32

Source§

impl DefaultMarker for NonZeroI64

Source§

impl DefaultMarker for NonZeroI128

Source§

impl DefaultMarker for NonZeroU8

Source§

impl DefaultMarker for NonZeroU16

Source§

impl DefaultMarker for NonZeroU32

Source§

impl DefaultMarker for NonZeroU64

Source§

impl DefaultMarker for NonZeroU128

Source§

impl DefaultMarker for Offset

Source§

impl DefaultMarker for Regex

Source§

impl DefaultMarker for SignedDuration

Source§

impl DefaultMarker for SmolStr

Source§

impl DefaultMarker for SocketAddr

Source§

impl DefaultMarker for SocketAddrV4

Source§

impl DefaultMarker for SocketAddrV6

Source§

impl DefaultMarker for String

Source§

impl DefaultMarker for Time

Source§

impl DefaultMarker for Timestamp

Source§

impl DefaultMarker for Uuid

Source§

impl DefaultMarker for Zoned

Source§

impl DefaultMarker for bool

Source§

impl DefaultMarker for f32

Source§

impl DefaultMarker for f64

Source§

impl DefaultMarker for i8

Source§

impl DefaultMarker for i16

Source§

impl DefaultMarker for i32

Source§

impl DefaultMarker for i64

Source§

impl DefaultMarker for i128

Source§

impl DefaultMarker for u8

Source§

impl DefaultMarker for u16

Source§

impl DefaultMarker for u32

Source§

impl DefaultMarker for u64

Source§

impl DefaultMarker for u128

Source§

impl<T: DefaultMarker> DefaultMarker for Option<T>

An Option is read as whatever the interpretation under it says an Option of it is read as — one blanket over every T, asking Marker::UnderOption rather than naming a wrapper.

The FAMILY is what answers, so Option<String> is a nullable text column and Option<Vec<Tag>> is a list. Naming NullableMarker here made the second one a Nullable<ListFilter<…>>, whose null test lowers to IS NULL against the table the record is kept in — which has no such column, a collection being kept beside it. The ruling is Marker::UnderOption’s; this row is where it is read, which is what makes a declaration naming marker = list and one naming nothing agree by construction.

One impl where the registry carried two rows per registered type (Option<T> and Option<Vec<T>>), and it reaches every type the map does — a downstream’s own included, which impl DefaultMarker for Option<TheirType> cannot (E0117).

§The bound is HERE and not on Marker::UnderOption

This trait requires its answer to resolve to a filter, and Marker promises no such thing on purpose: it is unconditional, so a marker over a type answering no family still says what it marks. An item bound of ToGraphqlFilter there would put each family’s own bound on each of those impls and take that away. Stated here it costs nothing at a concrete type, which is what an expansion projects.

Source§

impl<T: DefaultVecMarker> DefaultMarker for Vec<T>

Source§

impl<const N: usize> DefaultMarker for [u8; N]

Implementors§

Source§

impl DefaultMarker for AudioCodec

Available on crate feature mediaframe only.

The interpretation a AudioCodec 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.

Its Marker::UnderOption is NullableMarker and not the collection reading: a codec occupies a column OF ITS OWN, so it can be NULL and the null state is a real observable — a track whose codec the demuxer could not name is not a track encoded with a codec called nothing.

Source§

impl DefaultMarker for BarcodePayloadKind

The interpretation a BarcodePayloadKind field is read under — the ENUM family’s, which is what puts Option<BarcodePayloadKind> on the isNull road.

Source§

impl DefaultMarker for Count

Source§

impl DefaultMarker for DetectedLanguage

Available on crate feature derive only.

The interpretation a DetectedLanguage field is read under — LanguageId’s reading, and this crate no longer mints either: a detection occupies five columns OF ITS OWN, so all five can be absent together, which is exactly the VALUE family CompositeMarker names.

Source§

impl DefaultMarker for Detection

The interpretation a Detection field is read under — the COMPOSITE reading, because the value occupies columns of its own and both can be absent together.

Source§

impl DefaultMarker for Label

The interpretation a Label field is read under — the TEXT family’s, which is what puts Option<Label> on the isNull road rather than on a collection’s.

Source§

impl DefaultMarker for Language

Available on crate feature derive only.

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§

impl DefaultMarker for LanguageId

Available on crate feature derive only.

The interpretation a LanguageId field is read under — Language’s reading, and this crate no longer mints either: an identity occupies four columns OF ITS OWN, so all four can be absent together, which is exactly the VALUE family CompositeMarker names — a track nobody tagged is not a track tagged und.

Source§

impl DefaultMarker for LocalTimestamp

Available on crate features derive and time only.

The interpretation a LocalTimestamp field is read under: it occupies columns of its own and all of them can be absent together, which is exactly the VALUE family CompositeMarker names.

Source§

impl DefaultMarker for MediaTimeRange

Available on crate feature mediatime only.

The interpretation a MediaTimeRange field is read under — the framework’s COMPOSITE reading, the third of the citizens to take it and for their reason.

Source§

impl DefaultMarker for MediaTimestamp

Available on crate feature mediatime only.

The interpretation a MediaTimestamp field is read under — Timebase’s reading, and this crate no longer mints either: a timestamp occupies columns of its own and all of them can be absent together, which is exactly the VALUE family CompositeMarker names.

Source§

impl DefaultMarker for NormCoord

Source§

impl DefaultMarker for Rate

Available on crate feature mediatime only.
Source§

impl DefaultMarker for Region

Available on crate feature derive only.

The interpretation a Region 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§

impl DefaultMarker for ScriptSubtag

Available on crate feature derive only.

The interpretation a ScriptSubtag 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§

impl DefaultMarker for SubtitleCodec

Available on crate feature mediaframe only.

The interpretation a SubtitleCodec 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.

Its Marker::UnderOption is NullableMarker and not the collection reading: a codec occupies a column OF ITS OWN, so it can be NULL and the null state is a real observable — a track whose codec the demuxer could not name is not a track encoded with a codec called nothing.

Source§

impl DefaultMarker for Symbology

The interpretation a Symbology field is read under — the ENUM family’s, which is what puts Option<Symbology> on the isNull road.

Source§

impl DefaultMarker for TimeRange

The interpretation a TimeRange field is read under — the framework’s COMPOSITE reading, which is the honest one for a value occupying FOUR columns OF ITS OWN: all four can be absent together, which is exactly the VALUE family CompositeMarker names.

Source§

impl DefaultMarker for Timebase

Available on crate feature mediatime only.

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

This crate used to MINT the marker here — a local TimebaseMarker<T> with its own Marker row — because the framework’s family words each named one of ITS filter kinds and a timebase’s filter is none of them. CompositeMarker is the family that was missing, and the row above is the answer the mint existed to supply, so the reading is the framework’s now and the FILTER stays this crate’s.

Its Marker::UnderOption is NullableMarker and not the collection reading, which is the property the mint had to state by hand: a timebase occupies two columns OF ITS OWN, so both can be NULL together and the null state is a real observable.

Source§

impl DefaultMarker for ingraph::Timestamp

Source§

impl DefaultMarker for Utf8Bytes

Source§

impl DefaultMarker for VideoCodec

Available on crate feature mediaframe only.

The interpretation a VideoCodec 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.

Its Marker::UnderOption is NullableMarker and not the collection reading: a codec occupies a column OF ITS OWN, so it can be NULL and the null state is a real observable — a track whose codec the demuxer could not name is not a track encoded with a codec called nothing.

Source§

impl<S: ConfidenceCarrier> DefaultMarker for Confidence<S>

Source§

impl<T: DefaultMarker> DefaultMarker for BarcodeDetection<T>

The interpretation a BarcodeDetection<T> field is read under — the COMPOSITE reading.

Source§

impl<T: DefaultMarker> DefaultMarker for BoundingBox<T>

The interpretation a BoundingBox<T> field is read under — the COMPOSITE reading, because the value occupies columns of its own and all four can be absent together.

The bound is the COMPONENT’s own default, which is the membership rule spelled as a bound exactly as TimeRanged<T>’s row spells its payload’s: a box has a default interpretation wherever its component has one. A component with none reaches E0277 naming ITSELF, which is the sentence a declaration’s author can act on.

Source§

impl<T: DefaultMarker> DefaultMarker for DocumentSegment<T>

The interpretation a DocumentSegment<T> field is read under — the COMPOSITE reading.

Source§

impl<T: DefaultMarker> DefaultMarker for LocatedDetection<T>

The interpretation a LocatedDetection<T> field is read under — the COMPOSITE reading, because the value occupies columns of its own and all six can be absent together.

Source§

impl<T: DefaultMarker> DefaultMarker for Point2<T>

The COMPOSITE reading, on BoundingBox’s terms: the value occupies columns of its own and both can be absent together.

Source§

impl<T: DefaultMarker> DefaultMarker for Quad<T>

The COMPOSITE reading, on the family’s terms.

Source§

impl<T: DefaultMarker> DefaultMarker for TextDetection<T>

The interpretation a TextDetection<T> field is read under — the COMPOSITE reading.

Source§

impl<T: DefaultMarker> DefaultMarker for TimeRanged<T>

The interpretation a TimeRanged<T> field is read under — the COMPOSITE reading, for TimeRange’s reason: the value occupies columns of its own, all of which can be absent together.

The bound is the PAYLOAD’s own default, and it is the membership rule spelled as a bound exactly as Confidence<S>’s width rows spell theirs: a timed payload has a default interpretation wherever its payload has one. A payload with none reaches E0277 naming ITSELF, which is the sentence a declaration’s author can act on — where a row without the bound would have named this wrapper and left them to work out which half was missing.

Source§

impl<T> DefaultMarker for Radians<T>