pub struct ReferenceXEnv;Expand description
Asks about tweets by writing down the address that would be asked.
Nothing here reaches anywhere: a request is the address itself, which is what makes what a tweet source decides before it asks anything readable without asking anything.
Trait Implementations§
Source§impl Clone for ReferenceXEnv
impl Clone for ReferenceXEnv
impl Copy for ReferenceXEnv
Source§impl Debug for ReferenceXEnv
impl Debug for ReferenceXEnv
Source§impl Default for ReferenceXEnv
impl Default for ReferenceXEnv
Source§impl XAttachmentAlg for ReferenceXEnv
impl XAttachmentAlg for ReferenceXEnv
Source§fn attachment(
&self,
identity: impl Into<String>,
kind: AttachmentKind,
address: impl Into<String>,
) -> XAttachment
fn attachment( &self, identity: impl Into<String>, kind: AttachmentKind, address: impl Into<String>, ) -> XAttachment
Source§impl XAttachmentViewAlg for ReferenceXEnv
impl XAttachmentViewAlg for ReferenceXEnv
Source§fn attachment_identity<'a>(&self, attachment: &'a XAttachment) -> &'a str
fn attachment_identity<'a>(&self, attachment: &'a XAttachment) -> &'a str
Source§fn attachment_kind(&self, attachment: &XAttachment) -> AttachmentKind
fn attachment_kind(&self, attachment: &XAttachment) -> AttachmentKind
Source§fn attachment_address<'a>(&self, attachment: &'a XAttachment) -> &'a str
fn attachment_address<'a>(&self, attachment: &'a XAttachment) -> &'a str
Source§impl XRequestAlg for ReferenceXEnv
impl XRequestAlg for ReferenceXEnv
Source§impl XRequestViewAlg for ReferenceXEnv
impl XRequestViewAlg for ReferenceXEnv
Source§fn request_address<'a>(&self, request: &'a String) -> &'a str
fn request_address<'a>(&self, request: &'a String) -> &'a str
Source§impl XSorts for ReferenceXEnv
impl XSorts for ReferenceXEnv
Source§type Attachment = XAttachment
type Attachment = XAttachment
Auto Trait Implementations§
impl Freeze for ReferenceXEnv
impl RefUnwindSafe for ReferenceXEnv
impl Send for ReferenceXEnv
impl Sync for ReferenceXEnv
impl Unpin for ReferenceXEnv
impl UnsafeUnpin for ReferenceXEnv
impl UnwindSafe for ReferenceXEnv
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,
Source§impl<This> GaugeLaws<This> for This
impl<This> GaugeLaws<This> for This
Source§fn gauge_laws(&self) -> Result<(), Error>
fn gauge_laws(&self) -> Result<(), Error>
Checks that a gauge states a share without claiming more resolution than it has.
The laws checked are:
- a gauge occupies its stated width whatever share it states;
- no share is stated as filled before it is reached, and none is stated twice;
- nothing stated is nothing filled, and everything stated fills the whole track;
- the stated text occupies exactly one cell per counted cell.
§Errors
Returns the first violated law.
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 moreSource§impl<This> IntoExt<This> for This
impl<This> IntoExt<This> for This
Source§fn to<R>(self) -> Rwhere
This: Into<R>,
fn to<R>(self) -> Rwhere
This: Into<R>,
A version of Into::into function that can be used to explicitly specify the target
conversion type.
use alux_sdk::*;
// `Into` requires context to infer the type,
let _: i64 = Into::into(42_i8);
// The opposite `From` requires context to infer the type,
let _: i64 = From::from(42_i8);
// `.to()` can be used in the same way as a postfix function (the same as `.into()`),
let _: i64 = 42_i8.to();
// but also with the type specified explicitly.
let _ = 42_i8.to::<i64>();
// Especially useful to chain multiple conversions inline.
let _: i64 = 42_i8.to::<i16>().to::<i32>().into();Source§impl<This> IntoIteratorExt<This> for This
impl<This> IntoIteratorExt<This> for This
Source§fn try_collect_vec<T, E>(self) -> Result<Vec<T>, E>
fn try_collect_vec<T, E>(self) -> Result<Vec<T>, E>
A variant of the try_collect and collect_vec combined function from the Itertools
library. The materialized value is a Vec inside a Result object.
Returns the first error without collecting later values.
use alux_sdk::*;
let values = [Ok::<_, &str>(1), Ok(2), Ok(3)]
.into_iter()
.try_collect_vec();
assert_eq!(values, Ok(vec![1, 2, 3]));Source§fn collect_exact<T>(self, n: usize) -> Option<Vec<T>>where
This: Iterator<Item = T>,
fn collect_exact<T>(self, n: usize) -> Option<Vec<T>>where
This: Iterator<Item = T>,
Takes exactly n elements from the iterator.
Returns Some(Vec<T>) if the iterator yields exactly n elements,
otherwise returns None.
use alux_sdk::*;
let v = [1, 2, 3];
assert_eq!(v.iter().copied().collect_exact(3), Some(vec![1, 2, 3]));
assert_eq!(v.iter().copied().collect_exact(4), None);
assert_eq!(v.iter().copied().collect_exact(2), None);Source§fn try_unzip<A, B, E>(self) -> Result<(Vec<A>, Vec<B>), E>
fn try_unzip<A, B, E>(self) -> Result<(Vec<A>, Vec<B>), E>
Efficiently splits an iterator of Result<(A, B), E> into two Vecs, short-circuiting on error.
Consumes the iterator, collecting all A elements into one vector and all B elements into another,
without first allocating an intermediate vector of tuples. Returns the tuple (Vec<A>, Vec<B>) on success,
or the first error encountered.
use alux_sdk::*;
let input = vec![Ok((1, "x")), Ok((2, "y"))];
let (xs, ys) = input.try_unzip::<_, _, ()>().unwrap();
assert_eq!(xs, vec![1, 2]);
assert_eq!(ys, vec!["x", "y"]);Source§impl<This> XLaws<This> for Thiswhere
This: XRequestAlg + XRequestViewAlg,
impl<This> XLaws<This> for Thiswhere
This: XRequestAlg + XRequestViewAlg,
Source§fn x_laws(&self) -> Result<(), Error>
fn x_laws(&self) -> Result<(), Error>
Checks that an address, a request, and a way of taking each mean one thing.
The laws checked are:
- every address of one tweet names that tweet, however it was written;
- an address naming no tweet names none, whatever else it looks like;
- asking about one tweet is a function of which tweet it is, and always carries a token;
- every way of taking is named by its own word and says what it does;
- taking everything accepts every kind, and each other way accepts its own and no other;
- every kind the answer names reads back as itself.
§Errors
Returns the first violated law.