pub enum TypeRef {
Show 16 variants
Base(BaseType, Span),
Named(Ident),
Result(Box<TypeRef>, Box<TypeRef>, Span),
Option(Box<TypeRef>, Span),
Effect(Box<TypeRef>, Span),
HttpResult(Box<TypeRef>, Span),
QueueResult(Span),
List(Box<TypeRef>, Span),
Map(Box<TypeRef>, Box<TypeRef>, Span),
Query(Box<TypeRef>, Span),
Stream(Box<TypeRef>, Span),
Connection(Box<TypeRef>, Span),
ValidationError(Span),
JsonError(Span),
Unit(Span),
Fn(Vec<TypeRef>, Box<TypeRef>, Span),
}Variants§
Base(BaseType, Span)
Named(Ident)
Result(Box<TypeRef>, Box<TypeRef>, Span)
Result[T, E] — the built-in generic Result type (v0.1).
Option(Box<TypeRef>, Span)
Option[T] — the built-in generic Option type (v0.2).
Effect(Box<TypeRef>, Span)
Effect[T] — the built-in generic Effect type (v0.5).
HttpResult(Box<TypeRef>, Span)
HttpResult[T] — the built-in HTTP-result sum (v0.9).
QueueResult(Span)
QueueResult — the built-in queue verdict sum (Ack | Retry),
non-generic; the required return of a queue handler (v0.44).
List(Box<TypeRef>, Span)
List[T] — the built-in generic immutable list type (v0.20b).
Map(Box<TypeRef>, Box<TypeRef>, Span)
Map[K, V] — the built-in generic immutable map type (v0.20b).
Keys are confined to value-keyable types
(bynk.types.unkeyable_map_key).
Query(Box<TypeRef>, Span)
Query[T] — the built-in lazy storage-read description (v0.91, ADR 0115).
Nameable in a pure helper’s return type; non-storable and non-boundary
(like Effect/Fn).
Stream(Box<TypeRef>, Span)
Stream[T] — the value-over-time primitive (v0.100, real-time track
slice 0). A lazy, pull-shaped sequence produced over time; non-storable
and non-boundary (like Query/Effect/Fn).
Connection(Box<TypeRef>, Span)
Connection[F] — a held WebSocket connection (v0.102, real-time track
slice 2). F is the server→client frame type. A Held resource:
non-serialisable, non-boundary, and governed by the linearity discipline
(§2.9); storable only in Cell[Option[Connection]] / Map[K, Connection].
ValidationError(Span)
ValidationError — the built-in error type used by refined-type
constructors (v0.1).
JsonError(Span)
JsonError — the built-in JSON-decode error type (v0.22b). A
uniform record (kind/path/message, all String) the codec
maps BoundaryError variants and parse failures into.
Unit(Span)
() — the unit type (v0.5).
Fn(Vec<TypeRef>, Box<TypeRef>, Span)
A -> B / (A, B) -> C / () -> B — a function type (v0.20a).
Right-associative; effectful iff the return type is Effect[_]
(the structural rule). Confined to non-boundary positions
(bynk.types.function_at_boundary).
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TypeRef
impl RefUnwindSafe for TypeRef
impl Send for TypeRef
impl Sync for TypeRef
impl Unpin for TypeRef
impl UnsafeUnpin for TypeRef
impl UnwindSafe for TypeRef
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling [Attribute] value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi [Quirk] value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the [Condition] value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);