pub struct StreamerValue {
pub text: String,
pub ast: Comprehension,
}Expand description
A comprehension bound as a value.
Fields§
§text: StringThe text after for, as the author wrote it (or, for a derived
producer, the derivation text).
ast: ComprehensionThe comprehension, with any derivation already applied.
Implementations§
Source§impl StreamerValue
impl StreamerValue
Sourcepub fn new(text: impl Into<String>, ast: Comprehension) -> Self
pub fn new(text: impl Into<String>, ast: Comprehension) -> Self
A streamer over ast with its source text.
Sourcepub fn element_names(&self) -> Vec<String>
pub fn element_names(&self) -> Vec<String>
Element names in tuple order.
Sourcepub fn metadata(&self) -> Metadata
pub fn metadata(&self) -> Metadata
The algebra’s metadata: cardinality, index addressability, and natural order.
Sourcepub fn cardinality(&self) -> CardinalityClass
pub fn cardinality(&self) -> CardinalityClass
The cardinality class of the tuple space.
Sourcepub fn compiled(&self) -> CompiledComprehension
pub fn compiled(&self) -> CompiledComprehension
Compile to the shared IR. Each call is independent.
Sourcepub fn coordinate_stream(&self) -> CoordinateStream ⓘ
pub fn coordinate_stream(&self) -> CoordinateStream ⓘ
A fresh coordinate stream with its own dispense cursor.
Sourcepub fn to_json(&self) -> String
pub fn to_json(&self) -> String
Serialize for transport through a const node argument. The
compiler lowers a producer binding to streamer("<json>").
Sourcepub fn from_json(payload: &str) -> Self
pub fn from_json(payload: &str) -> Self
Build from a node argument: either the JSON payload the compiler
emits for for expressions, or plain comprehension text such as
k in 1..4 when an author calls streamer directly. Panics
with the parser’s diagnostic when neither form applies.
Sourcepub fn parse_text(text: &str) -> Result<Self, String>
pub fn parse_text(text: &str) -> Result<Self, String>
Parse canonical comprehension text into a streamer value.
Trait Implementations§
Source§impl Clone for StreamerValue
impl Clone for StreamerValue
Source§fn clone(&self) -> StreamerValue
fn clone(&self) -> StreamerValue
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StreamerValue
impl Debug for StreamerValue
Source§impl<'de> Deserialize<'de> for StreamerValue
impl<'de> Deserialize<'de> for StreamerValue
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for StreamerValue
impl PartialEq for StreamerValue
Source§impl ReflectedValue for StreamerValue
impl ReflectedValue for StreamerValue
Source§fn display(&self) -> String
fn display(&self) -> String
Source§fn to_json_value(&self) -> Value
fn to_json_value(&self) -> Value
Source§fn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
Source§fn clone_reflected(&self) -> Box<dyn ReflectedValue>
fn clone_reflected(&self) -> Box<dyn ReflectedValue>
Source§fn try_as_str(&self) -> Option<String>
fn try_as_str(&self) -> Option<String>
Source§fn try_as_u64(&self) -> Option<u64>
fn try_as_u64(&self) -> Option<u64>
Source§fn try_as_f64(&self) -> Option<f64>
fn try_as_f64(&self) -> Option<f64>
Source§fn try_as_bytes(&self) -> Option<&[u8]>
fn try_as_bytes(&self) -> Option<&[u8]>
Source§impl Serialize for StreamerValue
impl Serialize for StreamerValue
impl StructuralPartialEq for StreamerValue
Auto Trait Implementations§
impl Freeze for StreamerValue
impl RefUnwindSafe for StreamerValue
impl Send for StreamerValue
impl Sync for StreamerValue
impl Unpin for StreamerValue
impl UnsafeUnpin for StreamerValue
impl UnwindSafe for StreamerValue
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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