Struct mz_storage_client::types::sources::SourceData
source · #[repr(transparent)]pub struct SourceData(pub Result<Row, DataflowError>);
Tuple Fields§
§0: Result<Row, DataflowError>
Methods from Deref<Target = Result<Row, DataflowError>>§
1.0.0 · sourcepub fn as_ref(&self) -> Result<&T, &E>
pub fn as_ref(&self) -> Result<&T, &E>
Converts from &Result<T, E>
to Result<&T, &E>
.
Produces a new Result
, containing a reference
into the original, leaving the original in place.
Examples
let x: Result<u32, &str> = Ok(2);
assert_eq!(x.as_ref(), Ok(&2));
let x: Result<u32, &str> = Err("Error");
assert_eq!(x.as_ref(), Err(&"Error"));
1.0.0 · sourcepub fn as_mut(&mut self) -> Result<&mut T, &mut E>
pub fn as_mut(&mut self) -> Result<&mut T, &mut E>
Converts from &mut Result<T, E>
to Result<&mut T, &mut E>
.
Examples
fn mutate(r: &mut Result<i32, i32>) {
match r.as_mut() {
Ok(v) => *v = 42,
Err(e) => *e = 0,
}
}
let mut x: Result<i32, i32> = Ok(2);
mutate(&mut x);
assert_eq!(x.unwrap(), 42);
let mut x: Result<i32, i32> = Err(13);
mutate(&mut x);
assert_eq!(x.unwrap_err(), 0);
1.47.0 · sourcepub fn as_deref(&self) -> Result<&<T as Deref>::Target, &E>where
T: Deref,
pub fn as_deref(&self) -> Result<&<T as Deref>::Target, &E>where T: Deref,
Converts from Result<T, E>
(or &Result<T, E>
) to Result<&<T as Deref>::Target, &E>
.
Coerces the Ok
variant of the original Result
via Deref
and returns the new Result
.
Examples
let x: Result<String, u32> = Ok("hello".to_string());
let y: Result<&str, &u32> = Ok("hello");
assert_eq!(x.as_deref(), y);
let x: Result<String, u32> = Err(42);
let y: Result<&str, &u32> = Err(&42);
assert_eq!(x.as_deref(), y);
1.47.0 · sourcepub fn as_deref_mut(&mut self) -> Result<&mut <T as Deref>::Target, &mut E>where
T: DerefMut,
pub fn as_deref_mut(&mut self) -> Result<&mut <T as Deref>::Target, &mut E>where T: DerefMut,
Converts from Result<T, E>
(or &mut Result<T, E>
) to Result<&mut <T as DerefMut>::Target, &mut E>
.
Coerces the Ok
variant of the original Result
via DerefMut
and returns the new Result
.
Examples
let mut s = "HELLO".to_string();
let mut x: Result<String, u32> = Ok("hello".to_string());
let y: Result<&mut str, &mut u32> = Ok(&mut s);
assert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), y);
let mut i = 42;
let mut x: Result<String, u32> = Err(42);
let y: Result<&mut str, &mut u32> = Err(&mut i);
assert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), y);
1.0.0 · sourcepub fn iter(&self) -> Iter<'_, T>
pub fn iter(&self) -> Iter<'_, T>
Returns an iterator over the possibly contained value.
The iterator yields one value if the result is Result::Ok
, otherwise none.
Examples
let x: Result<u32, &str> = Ok(7);
assert_eq!(x.iter().next(), Some(&7));
let x: Result<u32, &str> = Err("nothing!");
assert_eq!(x.iter().next(), None);
1.0.0 · sourcepub fn iter_mut(&mut self) -> IterMut<'_, T>
pub fn iter_mut(&mut self) -> IterMut<'_, T>
Returns a mutable iterator over the possibly contained value.
The iterator yields one value if the result is Result::Ok
, otherwise none.
Examples
let mut x: Result<u32, &str> = Ok(7);
match x.iter_mut().next() {
Some(v) => *v = 40,
None => {},
}
assert_eq!(x, Ok(40));
let mut x: Result<u32, &str> = Err("nothing!");
assert_eq!(x.iter_mut().next(), None);
Trait Implementations§
source§impl Clone for SourceData
impl Clone for SourceData
source§fn clone(&self) -> SourceData
fn clone(&self) -> SourceData
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Codec for SourceData
impl Codec for SourceData
source§impl Debug for SourceData
impl Debug for SourceData
source§impl Deref for SourceData
impl Deref for SourceData
source§impl DerefMut for SourceData
impl DerefMut for SourceData
source§impl<'de> Deserialize<'de> for SourceData
impl<'de> Deserialize<'de> for SourceData
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 Ord for SourceData
impl Ord for SourceData
source§fn cmp(&self, other: &SourceData) -> Ordering
fn cmp(&self, other: &SourceData) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl<'a> PartDecoder<'a, SourceData> for SourceDataDecoder<'a>
impl<'a> PartDecoder<'a, SourceData> for SourceDataDecoder<'a>
source§impl<'a> PartEncoder<'a, SourceData> for SourceDataEncoder<'a>
impl<'a> PartEncoder<'a, SourceData> for SourceDataEncoder<'a>
source§fn encode(&mut self, val: &SourceData)
fn encode(&mut self, val: &SourceData)
source§impl PartialEq<SourceData> for SourceData
impl PartialEq<SourceData> for SourceData
source§fn eq(&self, other: &SourceData) -> bool
fn eq(&self, other: &SourceData) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<SourceData> for SourceData
impl PartialOrd<SourceData> for SourceData
source§fn partial_cmp(&self, other: &SourceData) -> Option<Ordering>
fn partial_cmp(&self, other: &SourceData) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl RustType<ProtoSourceData> for SourceData
impl RustType<ProtoSourceData> for SourceData
source§fn into_proto(&self) -> ProtoSourceData
fn into_proto(&self) -> ProtoSourceData
Self
into a Proto
value.source§fn from_proto(proto: ProtoSourceData) -> Result<Self, TryFromProtoError>
fn from_proto(proto: ProtoSourceData) -> Result<Self, TryFromProtoError>
source§impl Schema<SourceData> for RelationDesc
impl Schema<SourceData> for RelationDesc
§type Encoder<'a> = SourceDataEncoder<'a>
type Encoder<'a> = SourceDataEncoder<'a>
§type Decoder<'a> = SourceDataDecoder<'a>
type Decoder<'a> = SourceDataDecoder<'a>
source§fn columns(&self) -> DynStructCfg
fn columns(&self) -> DynStructCfg
source§impl Serialize for SourceData
impl Serialize for SourceData
impl Eq for SourceData
impl StructuralEq for SourceData
impl StructuralPartialEq for SourceData
Auto Trait Implementations§
impl RefUnwindSafe for SourceData
impl Send for SourceData
impl Sync for SourceData
impl Unpin for SourceData
impl UnwindSafe for SourceData
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
impl<P, R> ProtoType<R> for Pwhere R: RustType<P>,
source§fn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
RustType::from_proto
.source§fn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
RustType::into_proto
.