Skip to main content

SignalSurrogate

Struct SignalSurrogate 

Source
pub struct SignalSurrogate<T>(/* private fields */);

Implementations§

Source§

impl<T> SignalSurrogate<T>
where for<'b> &'b T: Surrogated,

Source

pub fn read(&self) -> <&T as Surrogated>::Surrogate

Borrows the current value.

Reads inside a runtime expression are the client-reactive path and do not register a dependency on the server; the server-side evaluation only records whether the expression needs a browser binding.

Source§

impl<T> SignalSurrogate<T>
where T: Surrogated + Clone,

Source

pub fn get(&self) -> <T as Surrogated>::Surrogate

Clones the current value.

Like read, this does not register a dependency on the server.

Source§

impl<T> SignalSurrogate<T>
where T: Surrogated,

Source

pub fn set(&self, _v: T::Surrogate)

Writes a new value to the signal.

§Panics

Always panics; signal writes can only occur in client-side expressions.

Source§

impl SignalSurrogate<bool>

Source

pub fn toggle(&self)

Replaces the value with its negation.

§Panics

Always panics; signal writes can only occur in client-side expressions.

Source§

impl SignalSurrogate<f64>

Source

pub fn increment(&self)

Adds one to the value.

§Panics

Always panics on the server. Integer overflow panics in the browser.

Source

pub fn decrement(&self)

Subtracts one from the value.

§Panics

Always panics on the server. Integer overflow panics in the browser.

Source§

impl SignalSurrogate<u8>

Source

pub fn increment(&self)

Adds one to the value.

§Panics

Always panics on the server. Integer overflow panics in the browser.

Source

pub fn decrement(&self)

Subtracts one from the value.

§Panics

Always panics on the server. Integer overflow panics in the browser.

Source§

impl SignalSurrogate<u16>

Source

pub fn increment(&self)

Adds one to the value.

§Panics

Always panics on the server. Integer overflow panics in the browser.

Source

pub fn decrement(&self)

Subtracts one from the value.

§Panics

Always panics on the server. Integer overflow panics in the browser.

Source§

impl SignalSurrogate<u32>

Source

pub fn increment(&self)

Adds one to the value.

§Panics

Always panics on the server. Integer overflow panics in the browser.

Source

pub fn decrement(&self)

Subtracts one from the value.

§Panics

Always panics on the server. Integer overflow panics in the browser.

Source§

impl SignalSurrogate<u64>

Source

pub fn increment(&self)

Adds one to the value.

§Panics

Always panics on the server. Integer overflow panics in the browser.

Source

pub fn decrement(&self)

Subtracts one from the value.

§Panics

Always panics on the server. Integer overflow panics in the browser.

Source§

impl SignalSurrogate<u128>

Source

pub fn increment(&self)

Adds one to the value.

§Panics

Always panics on the server. Integer overflow panics in the browser.

Source

pub fn decrement(&self)

Subtracts one from the value.

§Panics

Always panics on the server. Integer overflow panics in the browser.

Source§

impl SignalSurrogate<usize>

Source

pub fn increment(&self)

Adds one to the value.

§Panics

Always panics on the server. Integer overflow panics in the browser.

Source

pub fn decrement(&self)

Subtracts one from the value.

§Panics

Always panics on the server. Integer overflow panics in the browser.

Source§

impl SignalSurrogate<i8>

Source

pub fn increment(&self)

Adds one to the value.

§Panics

Always panics on the server. Integer overflow panics in the browser.

Source

pub fn decrement(&self)

Subtracts one from the value.

§Panics

Always panics on the server. Integer overflow panics in the browser.

Source§

impl SignalSurrogate<i16>

Source

pub fn increment(&self)

Adds one to the value.

§Panics

Always panics on the server. Integer overflow panics in the browser.

Source

pub fn decrement(&self)

Subtracts one from the value.

§Panics

Always panics on the server. Integer overflow panics in the browser.

Source§

impl SignalSurrogate<i32>

Source

pub fn increment(&self)

Adds one to the value.

§Panics

Always panics on the server. Integer overflow panics in the browser.

Source

pub fn decrement(&self)

Subtracts one from the value.

§Panics

Always panics on the server. Integer overflow panics in the browser.

Source§

impl SignalSurrogate<i64>

Source

pub fn increment(&self)

Adds one to the value.

§Panics

Always panics on the server. Integer overflow panics in the browser.

Source

pub fn decrement(&self)

Subtracts one from the value.

§Panics

Always panics on the server. Integer overflow panics in the browser.

Source§

impl SignalSurrogate<i128>

Source

pub fn increment(&self)

Adds one to the value.

§Panics

Always panics on the server. Integer overflow panics in the browser.

Source

pub fn decrement(&self)

Subtracts one from the value.

§Panics

Always panics on the server. Integer overflow panics in the browser.

Source§

impl SignalSurrogate<isize>

Source

pub fn increment(&self)

Adds one to the value.

§Panics

Always panics on the server. Integer overflow panics in the browser.

Source

pub fn decrement(&self)

Subtracts one from the value.

§Panics

Always panics on the server. Integer overflow panics in the browser.

Source§

impl SignalSurrogate<String>

Source

pub fn push_str(&self, _s: impl Deref<Target = StrSurrogate>)

Appends a string to the end of the value.

Accepts borrowed or owned strings, including an event target’s value.

§Panics

Always panics; signal writes can only occur in client-side expressions.

Trait Implementations§

Source§

impl<T: Debug> Debug for SignalSurrogate<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de, T> Deserialize<'de> for SignalSurrogate<T>
where T: Surrogated, T::Surrogate: Deserialize<'de>,

A signal sent by the client, as an argument to a run: its id next to its current value.

The value is required. A run cannot read a signal it has no value for, so a client that sends only the id is rejected the same way as one that sends a value of the wrong shape.

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<T> RefCast for SignalSurrogate<T>

Source§

type From = Signal<T>

Source§

fn ref_cast(_from: &Self::From) -> &Self

Source§

fn ref_cast_mut(_from: &mut Self::From) -> &mut Self

Source§

impl<T> Serialize for SignalSurrogate<T>

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<T> Surrogate for SignalSurrogate<T>

Source§

type Real = Signal<T>

Source§

fn into_real(self) -> Self::Real

Source§

impl<'__lifetime, T> Surrogate for &'__lifetime SignalSurrogate<T>

Source§

type Real = &'__lifetime Signal<T>

Source§

fn into_real(self) -> Self::Real

Source§

impl<'__lifetime, T> Surrogate for &'__lifetime mut SignalSurrogate<T>

Source§

type Real = &'__lifetime mut Signal<T>

Source§

fn into_real(self) -> Self::Real

Auto Trait Implementations§

§

impl<T> Freeze for SignalSurrogate<T>
where Signal<T>: Freeze,

§

impl<T> RefUnwindSafe for SignalSurrogate<T>

§

impl<T> Send for SignalSurrogate<T>
where Signal<T>: Send,

§

impl<T> Sync for SignalSurrogate<T>
where Signal<T>: Sync,

§

impl<T> Unpin for SignalSurrogate<T>
where Signal<T>: Unpin,

§

impl<T> UnsafeUnpin for SignalSurrogate<T>
where Signal<T>: UnsafeUnpin,

§

impl<T> UnwindSafe for SignalSurrogate<T>
where Signal<T>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more