Enum Oco

pub enum Oco<'a, T>
where T: ToOwned + 'a + ?Sized,
{ Borrowed(&'a T), Counted(Arc<T>), Owned(<T as ToOwned>::Owned), }
Expand description

“Owned Clones Once”: a smart pointer that can be either a reference, an owned value, or a reference-counted pointer. This is useful for storing immutable values, such as strings, in a way that is cheap to clone and pass around.

The cost of the Clone implementation depends on the branch. Cloning the Oco::Borrowed variant simply copies the references (O(1)). Cloning the Oco::Counted variant increments a reference count (O(1)). Cloning the Oco::Owned variant requires an O(n) clone of the data.

For an amortized O(1) clone, you can use Oco::clone_inplace(). Using this method, Oco::Borrowed and Oco::Counted are still O(1). Oco::Owned does a single O(n) clone, but converts the object to the Oco::Counted branch, which means future clones will be O(1).

In general, you’ll either want to call clone_inplace() once, before sharing the Oco with other parts of your application (so that all future clones are O(1)), or simply use this as if it is a Cow with an additional branch for reference-counted values.

Variants§

§

Borrowed(&'a T)

A static reference to a value.

§

Counted(Arc<T>)

A reference counted pointer to a value.

§

Owned(<T as ToOwned>::Owned)

An owned value.

Implementations§

§

impl<T> Oco<'_, T>
where T: ToOwned + ?Sized,

pub fn into_owned(self) -> <T as ToOwned>::Owned

Converts the value into an owned value.

pub const fn is_borrowed(&self) -> bool

Checks if the value is Oco::Borrowed.

§Examples
assert!(Oco::<str>::Borrowed("Hello").is_borrowed());
assert!(!Oco::<str>::Counted(Arc::from("Hello")).is_borrowed());
assert!(!Oco::<str>::Owned("Hello".to_string()).is_borrowed());

pub const fn is_counted(&self) -> bool

Checks if the value is Oco::Counted.

§Examples
assert!(Oco::<str>::Counted(Arc::from("Hello")).is_counted());
assert!(!Oco::<str>::Borrowed("Hello").is_counted());
assert!(!Oco::<str>::Owned("Hello".to_string()).is_counted());

pub const fn is_owned(&self) -> bool

Checks if the value is Oco::Owned.

§Examples
assert!(Oco::<str>::Owned("Hello".to_string()).is_owned());
assert!(!Oco::<str>::Borrowed("Hello").is_owned());
assert!(!Oco::<str>::Counted(Arc::from("Hello")).is_owned());
§

impl Oco<'_, str>

pub fn as_str(&self) -> &str

Returns a &str slice of this Oco.

§Examples
let oco = Oco::<str>::Borrowed("Hello");
let s: &str = oco.as_str();
assert_eq!(s, "Hello");
§

impl Oco<'_, CStr>

pub fn as_c_str(&self) -> &CStr

Returns a &CStr slice of this Oco.

§Examples
use std::ffi::CStr;

let oco =
    Oco::<CStr>::Borrowed(CStr::from_bytes_with_nul(b"Hello\0").unwrap());
let s: &CStr = oco.as_c_str();
assert_eq!(s, CStr::from_bytes_with_nul(b"Hello\0").unwrap());
§

impl Oco<'_, OsStr>

pub fn as_os_str(&self) -> &OsStr

Returns a &OsStr slice of this Oco.

§Examples
use std::ffi::OsStr;

let oco = Oco::<OsStr>::Borrowed(OsStr::new("Hello"));
let s: &OsStr = oco.as_os_str();
assert_eq!(s, OsStr::new("Hello"));
§

impl Oco<'_, Path>

pub fn as_path(&self) -> &Path

Returns a &Path slice of this Oco.

§Examples
use std::path::Path;

let oco = Oco::<Path>::Borrowed(Path::new("Hello"));
let s: &Path = oco.as_path();
assert_eq!(s, Path::new("Hello"));
§

impl<T> Oco<'_, [T]>
where [T]: ToOwned,

pub fn as_slice(&self) -> &[T]

Returns a &[T] slice of this Oco.

§Examples
let oco = Oco::<[u8]>::Borrowed(b"Hello");
let s: &[u8] = oco.as_slice();
assert_eq!(s, b"Hello");
§

impl<'a, T> Oco<'a, T>
where T: ToOwned + 'a + ?Sized, Arc<T>: for<'b> From<&'b T>,

pub fn upgrade_inplace(&mut self)

Upgrades the value in place, by converting into Oco::Counted if it was previously Oco::Owned.

§Examples
let mut oco1 = Oco::<str>::Owned("Hello".to_string());
assert!(oco1.is_owned());
oco1.upgrade_inplace();
assert!(oco1.is_counted());

pub fn clone_inplace(&mut self) -> Oco<'a, T>

Clones the value with inplace conversion into Oco::Counted if it was previously Oco::Owned.

§Examples
let mut oco1 = Oco::<str>::Owned("Hello".to_string());
let oco2 = oco1.clone_inplace();
assert_eq!(oco1, oco2);
assert!(oco1.is_counted());
assert!(oco2.is_counted());

Trait Implementations§

§

impl<'b> Add<&'b str> for Oco<'_, str>

§

type Output = Oco<'static, str>

The resulting type after applying the + operator.
§

fn add(self, rhs: &'b str) -> <Oco<'_, str> as Add<&'b str>>::Output

Performs the + operation. Read more
§

impl<'b> Add<Cow<'b, str>> for Oco<'_, str>

§

type Output = Oco<'static, str>

The resulting type after applying the + operator.
§

fn add(self, rhs: Cow<'b, str>) -> <Oco<'_, str> as Add<Cow<'b, str>>>::Output

Performs the + operation. Read more
§

impl<'b> Add<Oco<'b, str>> for Oco<'_, str>

§

type Output = Oco<'static, str>

The resulting type after applying the + operator.
§

fn add(self, rhs: Oco<'b, str>) -> <Oco<'_, str> as Add<Oco<'b, str>>>::Output

Performs the + operation. Read more
§

impl<'a> AddAnyAttr for Oco<'static, str>

§

type Output<SomeNewAttr: Attribute> = Oco<'static, str>

The new type once the attribute has been added.
§

fn add_any_attr<NewAttr>( self, _attr: NewAttr, ) -> <Oco<'static, str> as AddAnyAttr>::Output<NewAttr>
where NewAttr: Attribute,

Adds an attribute to the view.
§

impl AsRef<Path> for Oco<'_, OsStr>

§

fn as_ref(&self) -> &Path

Converts this type into a shared reference of the (usually inferred) input type.
§

impl AsRef<Path> for Oco<'_, str>

§

fn as_ref(&self) -> &Path

Converts this type into a shared reference of the (usually inferred) input type.
§

impl<T> AsRef<T> for Oco<'_, T>
where T: ToOwned + ?Sized,

§

fn as_ref(&self) -> &T

Converts this type into a shared reference of the (usually inferred) input type.
§

impl AttributeValue for Oco<'static, str>

§

type AsyncOutput = Oco<'static, str>

The type once all async data have loaded.
§

type State = (Element, Oco<'static, str>)

The state that should be retained between building and rebuilding.
§

type Cloneable = Oco<'static, str>

A version of the value that can be cloned. This can be the same type, or a reference-counted type. Generally speaking, this does not need to refer to the same data, but should behave in the same way. So for example, making an event handler cloneable should probably make it reference-counted (so that a FnMut() continues mutating the same closure), but making a String cloneable does not necessarily need to make it an Arc<str>, as two different clones of a String will still have the same value.
§

type CloneableOwned = Oco<'static, str>

A cloneable type that is also 'static. This is used for spreading across types when the spreadable attribute needs to be owned. In some cases (&'a str to Arc<str>, etc.) the owned cloneable type has worse performance than the cloneable type, so they are separate.
§

fn html_len(&self) -> usize

An approximation of the actual length of this attribute in HTML.
§

fn to_html(self, key: &str, buf: &mut String)

Renders the attribute value to HTML.
§

fn to_template(_key: &str, _buf: &mut String)

Renders the attribute value to HTML for a <template>.
§

fn hydrate<const FROM_SERVER: bool>( self, key: &str, el: &Element, ) -> <Oco<'static, str> as AttributeValue>::State

Adds interactivity as necessary, given DOM nodes that were created from HTML that has either been rendered on the server, or cloned for a <template>.
§

fn build( self, el: &Element, key: &str, ) -> <Oco<'static, str> as AttributeValue>::State

Adds this attribute to the element during client-side rendering.
§

fn rebuild( self, key: &str, state: &mut <Oco<'static, str> as AttributeValue>::State, )

Applies a new value for the attribute.
§

fn into_cloneable(self) -> <Oco<'static, str> as AttributeValue>::Cloneable

Converts this attribute into an equivalent that can be cloned.
§

fn into_cloneable_owned( self, ) -> <Oco<'static, str> as AttributeValue>::CloneableOwned

Converts this attributes into an equivalent that can be cloned and is 'static.
§

fn dry_resolve(&mut self)

“Runs” the attribute without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
§

async fn resolve(self) -> <Oco<'static, str> as AttributeValue>::AsyncOutput

“Resolves” this into a form that is not waiting for any asynchronous data.
§

impl<T> Borrow<T> for Oco<'_, T>
where T: ToOwned + ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<'a, T> Clone for Oco<'a, T>
where T: ToOwned + 'a + ?Sized, Arc<T>: for<'b> From<&'b T>,

§

fn clone(&self) -> Oco<'a, T>

Returns a new Oco with the same value as this one. If the value is Oco::Owned, this will convert it into Oco::Counted, so that the next clone will be O(1).

§Examples

String :

let oco = Oco::<str>::Owned("Hello".to_string());
let oco2 = oco.clone();
assert_eq!(oco, oco2);
assert!(oco2.is_counted());

Vec :

let oco = Oco::<[u8]>::Owned(b"Hello".to_vec());
let oco2 = oco.clone();
assert_eq!(oco, oco2);
assert!(oco2.is_counted());
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<T> Debug for Oco<'_, T>
where T: Debug + ToOwned + ?Sized,

§

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

Formats the value using the given formatter. Read more
§

impl<T> Default for Oco<'_, T>
where T: ToOwned + ?Sized, <T as ToOwned>::Owned: Default,

§

fn default() -> Oco<'_, T>

Returns the “default value” for a type. Read more
§

impl<T> Deref for Oco<'_, T>
where T: ToOwned + ?Sized,

§

type Target = T

The resulting type after dereferencing.
§

fn deref(&self) -> &T

Dereferences the value.
§

impl<'a, T> Deserialize<'a> for Oco<'static, T>
where T: ToOwned + 'a + ?Sized, <T as ToOwned>::Owned: DeserializeOwned,

§

fn deserialize<D>( deserializer: D, ) -> Result<Oco<'static, T>, <D as Deserializer<'a>>::Error>
where D: Deserializer<'a>,

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

impl<T> Display for Oco<'_, T>
where T: Display + ToOwned + ?Sized,

§

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

Formats the value using the given formatter. Read more
§

impl<'a, T, const N: usize> From<&'a [T; N]> for Oco<'a, [T]>
where [T]: ToOwned,

§

fn from(v: &'a [T; N]) -> Oco<'a, [T]>

Converts to this type from the input type.
§

impl<'a, T> From<&'a T> for Oco<'a, T>
where T: ToOwned + ?Sized,

§

fn from(v: &'a T) -> Oco<'a, T>

Converts to this type from the input type.
§

impl<T> From<Arc<T>> for Oco<'_, T>
where T: ToOwned + ?Sized,

§

fn from(v: Arc<T>) -> Oco<'_, T>

Converts to this type from the input type.
§

impl<T> From<Box<T>> for Oco<'_, T>
where T: ToOwned + ?Sized,

§

fn from(v: Box<T>) -> Oco<'_, T>

Converts to this type from the input type.
§

impl<'a, T> From<Cow<'a, T>> for Oco<'a, T>
where T: ToOwned + ?Sized,

§

fn from(v: Cow<'a, T>) -> Oco<'a, T>

Converts to this type from the input type.
§

impl From<Oco<'_, str>> for String

§

fn from(v: Oco<'_, str>) -> String

Converts to this type from the input type.
§

impl<'a, T> From<Oco<'a, T>> for Cow<'a, T>
where T: ToOwned + ?Sized,

§

fn from(value: Oco<'a, T>) -> Cow<'a, T>

Converts to this type from the input type.
§

impl<'a> From<Oco<'a, str>> for Oco<'a, [u8]>

§

fn from(v: Oco<'a, str>) -> Oco<'a, [u8]>

Converts to this type from the input type.
§

impl From<Oco<'static, str>> for TextProp

§

fn from(s: Oco<'static, str>) -> TextProp

Converts to this type from the input type.
§

impl From<String> for Oco<'_, str>

§

fn from(v: String) -> Oco<'_, str>

Converts to this type from the input type.
§

impl<T> From<Vec<T>> for Oco<'_, [T]>
where [T]: ToOwned<Owned = Vec<T>>,

§

fn from(v: Vec<T>) -> Oco<'_, [T]>

Converts to this type from the input type.
§

impl<'a> FromIterator<Oco<'a, str>> for String

§

fn from_iter<T>(iter: T) -> String
where T: IntoIterator<Item = Oco<'a, str>>,

Creates a value from an iterator. Read more
§

impl<T> Hash for Oco<'_, T>
where T: Hash + ToOwned + ?Sized,

§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl IntoClass for Oco<'static, str>

§

type AsyncOutput = Oco<'static, str>

The type after all async data have resolved.
§

type State = (Element, Oco<'static, str>)

The view state retained between building and rebuilding.
§

type Cloneable = Oco<'static, str>

An equivalent value that can be cloned.
§

type CloneableOwned = Oco<'static, str>

An equivalent value that can be cloned and is 'static.
§

fn html_len(&self) -> usize

The estimated length of the HTML.
§

fn to_html(self, class: &mut String)

Renders the class to HTML.
§

fn hydrate<const FROM_SERVER: bool>( self, el: &Element, ) -> <Oco<'static, str> as IntoClass>::State

Adds interactivity as necessary, given DOM nodes that were created from HTML that has either been rendered on the server, or cloned for a <template>.
§

fn build(self, el: &Element) -> <Oco<'static, str> as IntoClass>::State

Adds this class to the element during client-side rendering.
§

fn rebuild(self, state: &mut <Oco<'static, str> as IntoClass>::State)

Updates the value.
§

fn into_cloneable(self) -> <Oco<'static, str> as IntoClass>::Cloneable

Converts this to a cloneable type.
§

fn into_cloneable_owned( self, ) -> <Oco<'static, str> as IntoClass>::CloneableOwned

Converts this to a cloneable, owned type.
§

fn dry_resolve(&mut self)

“Runs” the attribute without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
§

async fn resolve(self) -> <Oco<'static, str> as IntoClass>::AsyncOutput

“Resolves” this into a type that is not waiting for any asynchronous data.
§

fn reset(state: &mut <Oco<'static, str> as IntoClass>::State)

Reset the class list to the state before this class was added.
§

const TEMPLATE: &'static str = ""

The HTML that should be included in a <template>.
§

const MIN_LENGTH: usize = _

The minimum length of the HTML.
§

fn to_template(class: &mut String)

Renders the class to HTML for a <template>.
§

impl IntoStyle for Oco<'static, str>

§

type AsyncOutput = Oco<'static, str>

The type after all async data have resolved.
§

type State = (Element, Oco<'static, str>)

The view state retained between building and rebuilding.
§

type Cloneable = Oco<'static, str>

An equivalent value that can be cloned.
§

type CloneableOwned = Oco<'static, str>

An equivalent value that can be cloned and is 'static.
§

fn to_html(self, style: &mut String)

Renders the style to HTML.
§

fn hydrate<const FROM_SERVER: bool>( self, el: &Element, ) -> <Oco<'static, str> as IntoStyle>::State

Adds interactivity as necessary, given DOM nodes that were created from HTML that has either been rendered on the server, or cloned for a <template>.
§

fn build(self, el: &Element) -> <Oco<'static, str> as IntoStyle>::State

Adds this style to the element during client-side rendering.
§

fn rebuild(self, state: &mut <Oco<'static, str> as IntoStyle>::State)

Updates the value.
§

fn into_cloneable(self) -> <Oco<'static, str> as IntoStyle>::Cloneable

Converts this to a cloneable type.
§

fn into_cloneable_owned( self, ) -> <Oco<'static, str> as IntoStyle>::CloneableOwned

Converts this to a cloneable, owned type.
§

fn dry_resolve(&mut self)

“Runs” the attribute without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
§

async fn resolve(self) -> <Oco<'static, str> as IntoStyle>::AsyncOutput

“Resolves” this into a type that is not waiting for any asynchronous data.
§

fn reset(state: &mut <Oco<'static, str> as IntoStyle>::State)

Reset the styling to the state before this style was added.
§

impl IntoStyleValue for Oco<'static, str>

§

type AsyncOutput = Oco<'static, str>

The type after all async data have resolved.
§

type State = Oco<'static, str>

The view state retained between building and rebuilding.
§

type Cloneable = Oco<'static, str>

An equivalent value that can be cloned.
§

type CloneableOwned = Oco<'static, str>

An equivalent value that can be cloned and is 'static.
§

fn to_html(self, name: &str, style: &mut String)

Renders the style to HTML.
§

fn build( self, style: &CssStyleDeclaration, name: &str, ) -> <Oco<'static, str> as IntoStyleValue>::State

Adds this style to the element during client-side rendering.
§

fn rebuild( self, style: &CssStyleDeclaration, name: &str, state: &mut <Oco<'static, str> as IntoStyleValue>::State, )

Updates the value.
§

fn hydrate( self, _style: &CssStyleDeclaration, _name: &str, ) -> <Oco<'static, str> as IntoStyleValue>::State

Adds interactivity as necessary, given DOM nodes that were created from HTML that has either been rendered on the server, or cloned for a <template>.
§

fn into_cloneable(self) -> <Oco<'static, str> as IntoStyleValue>::Cloneable

Converts this to a cloneable type.
§

fn into_cloneable_owned( self, ) -> <Oco<'static, str> as IntoStyleValue>::CloneableOwned

Converts this to a cloneable, owned type.
§

fn dry_resolve(&mut self)

“Runs” the attribute without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
§

async fn resolve(self) -> <Oco<'static, str> as IntoStyleValue>::AsyncOutput

“Resolves” this into a type that is not waiting for any asynchronous data.
§

impl<T> Ord for Oco<'_, T>
where T: Ord + ToOwned + ?Sized,

§

fn cmp(&self, other: &Oco<'_, T>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
§

impl<'a, 'b, T> PartialEq<&'b [T]> for Oco<'a, [T]>
where T: PartialEq, [T]: ToOwned,

§

fn eq(&self, other: &&'b [T]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<'a, 'b> PartialEq<&'b str> for Oco<'a, str>

§

fn eq(&self, other: &&'b str) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<T> PartialEq<[T]> for Oco<'_, [T]>
where T: PartialEq, [T]: ToOwned,

§

fn eq(&self, other: &[T]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<'a, 'b, T> PartialEq<Cow<'b, [T]>> for Oco<'a, [T]>
where T: PartialEq, [T]: ToOwned,

§

fn eq(&self, other: &Cow<'b, [T]>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<'a, 'b> PartialEq<Cow<'b, str>> for Oco<'a, str>

§

fn eq(&self, other: &Cow<'b, str>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<T> PartialEq<Oco<'_, [T]>> for [T]
where T: PartialEq, [T]: ToOwned,

§

fn eq(&self, other: &Oco<'_, [T]>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<T> PartialEq<Oco<'_, [T]>> for Vec<T>
where T: PartialEq, [T]: ToOwned,

§

fn eq(&self, other: &Oco<'_, [T]>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<Oco<'_, str>> for String

§

fn eq(&self, other: &Oco<'_, str>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<Oco<'_, str>> for str

§

fn eq(&self, other: &Oco<'_, str>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<'a, 'b, T> PartialEq<Oco<'a, [T]>> for &'b [T]
where T: PartialEq, [T]: ToOwned,

§

fn eq(&self, other: &Oco<'a, [T]>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<'a, 'b, T> PartialEq<Oco<'a, [T]>> for Cow<'b, [T]>
where T: PartialEq, [T]: ToOwned,

§

fn eq(&self, other: &Oco<'a, [T]>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<'a, 'b> PartialEq<Oco<'a, str>> for &'b str

§

fn eq(&self, other: &Oco<'a, str>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<'a, 'b> PartialEq<Oco<'a, str>> for Cow<'b, str>

§

fn eq(&self, other: &Oco<'a, str>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<'b, A, B> PartialEq<Oco<'b, B>> for Oco<'_, A>
where A: PartialEq<B> + ToOwned + ?Sized, B: ToOwned + ?Sized,

§

fn eq(&self, other: &Oco<'b, B>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<String> for Oco<'_, str>

§

fn eq(&self, other: &String) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<T> PartialEq<Vec<T>> for Oco<'_, [T]>
where T: PartialEq, [T]: ToOwned,

§

fn eq(&self, other: &Vec<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<str> for Oco<'_, str>

§

fn eq(&self, other: &str) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<'b, A, B> PartialOrd<Oco<'b, B>> for Oco<'_, A>
where A: PartialOrd<B> + ToOwned + ?Sized, B: ToOwned + ?Sized,

§

fn partial_cmp(&self, other: &Oco<'b, B>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

impl Render for Oco<'static, str>

§

type State = OcoStrState

The “view state” for this type, which can be retained between updates. Read more
§

fn build(self) -> <Oco<'static, str> as Render>::State

Creates the view for the first time, without hydrating from existing HTML.
§

fn rebuild(self, state: &mut <Oco<'static, str> as Render>::State)

Updates the view with new data.
§

impl RenderHtml for Oco<'static, str>

§

const MIN_LENGTH: usize = 0usize

The minimum length of HTML created when this view is rendered.
§

type AsyncOutput = Oco<'static, str>

The type of the view after waiting for all asynchronous data to load.
§

type Owned = Oco<'static, str>

An equivalent value that is 'static.
§

fn dry_resolve(&mut self)

“Runs” the view without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
§

async fn resolve(self) -> <Oco<'static, str> as RenderHtml>::AsyncOutput

Waits for any asynchronous sections of the view to load and returns the output.
§

fn to_html_with_buf( self, buf: &mut String, position: &mut Position, escape: bool, mark_branches: bool, extra_attrs: Vec<AnyAttribute>, )

Renders a view to HTML, writing it into the given buffer.
§

fn hydrate<const FROM_SERVER: bool>( self, cursor: &Cursor, position: &PositionState, ) -> <Oco<'static, str> as Render>::State

Makes a set of DOM nodes rendered from HTML interactive. Read more
§

fn into_owned(self) -> <Oco<'static, str> as RenderHtml>::Owned

Convert into the equivalent value that is 'static.
§

const EXISTS: bool = true

Whether this should actually exist in the DOM, if it is the child of an element.
§

fn html_len(&self) -> usize

An estimated length for this view, when rendered to HTML. Read more
§

fn to_html(self) -> String
where Self: Sized,

Renders a view to an HTML string.
§

fn to_html_branching(self) -> String
where Self: Sized,

Renders a view to HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
§

fn to_html_stream_in_order(self) -> StreamBuilder
where Self: Sized,

Renders a view to an in-order stream of HTML.
§

fn to_html_stream_in_order_branching(self) -> StreamBuilder
where Self: Sized,

Renders a view to an in-order stream of HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
§

fn to_html_stream_out_of_order(self) -> StreamBuilder
where Self: Sized,

Renders a view to an out-of-order stream of HTML.
§

fn to_html_stream_out_of_order_branching(self) -> StreamBuilder
where Self: Sized,

Renders a view to an out-of-order stream of HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
§

fn to_html_async_with_buf<const OUT_OF_ORDER: bool>( self, buf: &mut StreamBuilder, position: &mut Position, escape: bool, mark_branches: bool, extra_attrs: Vec<AnyAttribute>, )
where Self: Sized,

Renders a view into a buffer of (synchronous or asynchronous) HTML chunks.
§

fn hydrate_async( self, cursor: &Cursor, position: &PositionState, ) -> impl Future<Output = Self::State>

Asynchronously makes a set of DOM nodes rendered from HTML interactive. Read more
§

fn hydrate_from<const FROM_SERVER: bool>(self, el: &Element) -> Self::State
where Self: Sized,

Hydrates using RenderHtml::hydrate, beginning at the given element.
§

fn hydrate_from_position<const FROM_SERVER: bool>( self, el: &Element, position: Position, ) -> Self::State
where Self: Sized,

Hydrates using RenderHtml::hydrate, beginning at the given element and position.
§

impl<'a, T> Serialize for Oco<'a, T>
where T: ToOwned + 'a + ?Sized, &'b T: for<'b> Serialize,

§

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

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

impl ToHref for Oco<'_, str>

§

fn to_href(&self) -> Box<dyn Fn() -> String + '_>

Converts the (static or reactive) URL into a function that can be called to return the URL.
§

impl ToTemplate for Oco<'static, str>

§

const TEMPLATE: &'static str = <&str as ToTemplate>::TEMPLATE

The HTML content of the static template.
§

fn to_template( buf: &mut String, class: &mut String, style: &mut String, inner_html: &mut String, position: &mut Position, )

Renders a view type to a template. This does not take actual view data, but can be used for constructing part of an HTML <template> that corresponds to a view of a particular type.
§

const CLASS: &'static str = ""

The class attribute content known at compile time.
§

const STYLE: &'static str = ""

The style attribute content known at compile time.
§

const LEN: usize = _

The length of the template.
§

fn to_template_attribute( buf: &mut String, class: &mut String, style: &mut String, inner_html: &mut String, position: &mut Position, )

Renders a view type to a template in attribute position.
§

impl<T> Eq for Oco<'_, T>
where T: ToOwned + Eq + ?Sized,

Auto Trait Implementations§

§

impl<'a, T> Freeze for Oco<'a, T>
where <T as ToOwned>::Owned: Freeze, T: ?Sized,

§

impl<'a, T> RefUnwindSafe for Oco<'a, T>

§

impl<'a, T> Send for Oco<'a, T>
where <T as ToOwned>::Owned: Send, T: Sync + Send + ?Sized,

§

impl<'a, T> Sync for Oco<'a, T>
where <T as ToOwned>::Owned: Sync, T: Sync + Send + ?Sized,

§

impl<'a, T> Unpin for Oco<'a, T>
where <T as ToOwned>::Owned: Unpin, T: ?Sized,

§

impl<'a, T> UnwindSafe for Oco<'a, T>
where <T as ToOwned>::Owned: UnwindSafe, T: RefUnwindSafe + ?Sized,

Blanket Implementations§

§

impl<T, A, P> Access<T> for P
where A: Access<T> + ?Sized, P: Deref<Target = A>,

§

type Guard = <A as Access<T>>::Guard

A guard object containing the value and keeping it alive. Read more
§

fn load(&self) -> <P as Access<T>>::Guard

The loading method. Read more
Source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>, D: AdaptFrom<S, Swp, Dwp, T>,

Source§

fn adapt_into_using<M>(self, method: M) -> D
where M: TransformMatrix<T>,

Convert the source color to the destination color using the specified method.
Source§

fn adapt_into(self) -> D

Convert the source color to the destination color using the bradford method by default.
Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T, C> ArraysFrom<C> for T
where C: IntoArrays<T>,

Source§

fn arrays_from(colors: C) -> T

Cast a collection of colors into a collection of arrays.
Source§

impl<T, C> ArraysInto<C> for T
where C: FromArrays<T>,

Source§

fn arrays_into(self) -> C

Cast this collection of arrays into a collection of colors.
§

impl<V, Key, Sig, T> BindAttribute<Key, Sig, T> for V
where V: AddAnyAttr, Key: AttributeKey, Sig: IntoSplitSignal<Value = T>, T: FromEventTarget + AttributeValue + PartialEq + Sync + 'static, Signal<BoolOrT<T>>: IntoProperty, <Sig as IntoSplitSignal>::Read: Get<Value = T> + Send + Sync + Clone + 'static, <Sig as IntoSplitSignal>::Write: Send + Clone + 'static, Element: GetValue<T>,

§

type Output = <V as AddAnyAttr>::Output<Bind<Key, T, <Sig as IntoSplitSignal>::Read, <Sig as IntoSplitSignal>::Write>>

The type of the element with the two-way binding added.
§

fn bind( self, key: Key, signal: Sig, ) -> <V as BindAttribute<Key, Sig, T>>::Output

Adds a two-way binding to the element, which adds an attribute and an event listener to the element when the element is created or hydrated. 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
§

impl<T> CallHasher for T
where T: Hash + ?Sized,

§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64
where H: Hash + ?Sized, B: BuildHasher,

Source§

impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for U
where T: FromCam16Unclamped<WpParam, U>,

Source§

type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar

The number type that’s used in parameters when converting.
Source§

fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T

Converts self into C, using the provided parameters.
§

impl<T> Casing<T> for T
where T: AsRef<str>, String: PartialEq<T>,

§

fn to_case(&self, case: Case) -> String

Convert the string into the given case. It will reference self and create a new String with the same pattern and delimeter as case. It will split on boundaries defined at [Boundary::defaults()]. Read more
§

fn with_boundaries(&self, bs: &[Boundary]) -> StateConverter<'_, T>

Creates a StateConverter struct initialized with the boundaries provided. Read more
§

fn from_case(&self, case: Case) -> StateConverter<'_, T>

Start the case conversion by storing the boundaries associated with the given case. Read more
§

fn is_case(&self, case: Case) -> bool

Determines if self is of the given case. This is done simply by applying the conversion and seeing if the result is the same. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<T, C> ComponentsFrom<C> for T
where C: IntoComponents<T>,

Source§

fn components_from(colors: C) -> T

Cast a collection of colors into a collection of color components.
§

impl<T, K, V> CustomAttribute<K, V> for T
where T: AddAnyAttr, K: CustomAttributeKey, V: AttributeValue,

§

fn attr(self, key: K, value: V) -> Self::Output<CustomAttr<K, V>>

Adds an HTML attribute by key and value.
§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

§

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
§

impl<V, T, P, D> DirectiveAttribute<T, P, D> for V
where V: AddAnyAttr, D: IntoDirective<T, P>, P: Clone + 'static, T: 'static,

§

type Output = <V as AddAnyAttr>::Output<Directive<T, D, P>>

The type of the element with the directive added.
§

fn directive( self, handler: D, param: P, ) -> <V as DirectiveAttribute<T, P, D>>::Output

Adds a directive to the element, which runs some custom logic in the browser when the element is created or hydrated.
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSend for T
where T: Any + Send,

§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
§

impl<T, A> DynAccess<T> for A
where A: Access<T>, <A as Access<T>>::Guard: 'static,

§

fn load(&self) -> DynGuard<T>

The equivalent of [Access::load].
§

impl<T> ElementExt for T
where T: AsRef<Element>,

§

fn attr<At>(&self, attribute: At) -> <At as Attribute>::State
where At: Attribute,

Adds an attribute to the element, at runtime.
§

fn class<C>(&self, class: C) -> <C as IntoClass>::State
where C: IntoClass,

Adds a class to the element, at runtime.
§

fn on<E>( &self, ev: E, cb: impl FnMut(<E as EventDescriptor>::EventType) + 'static, ) -> RemoveEventHandler<Element>
where E: EventDescriptor + Send + 'static, <E as EventDescriptor>::EventType: 'static + From<JsValue>,

Adds an event listener to the element, at runtime.
§

fn style<S>(&self, style: S) -> <S as IntoStyle>::State
where S: IntoStyle,

Adds a style to the element, at runtime.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromAngle<T> for T

Source§

fn from_angle(angle: T) -> T

Performs a conversion from angle.
§

impl<T> FromFormData for T

§

fn from_event(ev: &Event) -> Result<T, FromFormDataError>

Tries to deserialize the data, given only the submit event.
§

fn from_form_data(form_data: &FormData) -> Result<T, Error>

Tries to deserialize the data, given the actual form data.
§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<E, T, Request> FromReq<DeleteUrl, Request, E> for T
where Request: Req<E> + Send + 'static, T: DeserializeOwned, E: FromServerFnError,

§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
§

impl<E, T, Request> FromReq<GetUrl, Request, E> for T
where Request: Req<E> + Send + 'static, T: DeserializeOwned, E: FromServerFnError,

§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
§

impl<E, T, Request, Encoding> FromReq<Patch<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
§

impl<E, T, Request> FromReq<PatchUrl, Request, E> for T
where Request: Req<E> + Send + 'static, T: DeserializeOwned, E: FromServerFnError,

§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
§

impl<E, T, Request, Encoding> FromReq<Post<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
§

impl<E, T, Request> FromReq<PostUrl, Request, E> for T
where Request: Req<E> + Send + 'static, T: DeserializeOwned, E: FromServerFnError,

§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
§

impl<E, T, Request, Encoding> FromReq<Put<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
§

impl<E, T, Request> FromReq<PutUrl, Request, E> for T
where Request: Req<E> + Send + 'static, T: DeserializeOwned, E: FromServerFnError,

§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
§

impl<E, Encoding, Response, T> FromRes<Patch<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

§

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
§

impl<E, Encoding, Response, T> FromRes<Post<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

§

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
§

impl<E, Encoding, Response, T> FromRes<Put<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

§

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
Source§

impl<T, U> FromStimulus<U> for T
where U: IntoStimulus<T>,

Source§

fn from_stimulus(other: U) -> T

Converts other into Self, while performing the appropriate scaling, rounding and clamping.
§

impl<T> HasLen for T
where T: Deref<Target = [u8]>,

§

fn len(&self) -> usize

Return length
§

fn is_empty(&self) -> bool

Returns true iff empty.
Source§

impl<T> Hexable for T
where T: Serialize + for<'de> Deserialize<'de>,

§

impl<T> Instrument for T

§

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

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

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, U> IntoAngle<U> for T
where U: FromAngle<T>,

Source§

fn into_angle(self) -> U

Performs a conversion into T.
§

impl<T> IntoAny for T
where T: Send + RenderHtml,

§

fn into_any(self) -> AnyView

Converts the view into a type-erased AnyView.
§

impl<T> IntoAttributeValue for T
where T: AttributeValue,

§

type Output = T

The attribute value into which this type can be converted.
§

fn into_attribute_value(self) -> <T as IntoAttributeValue>::Output

Consumes this value, transforming it into an attribute value.
Source§

impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for U
where T: Cam16FromUnclamped<WpParam, U>,

Source§

type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar

The number type that’s used in parameters when converting.
Source§

fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T

Converts self into C, using the provided parameters.
Source§

impl<T, U> IntoColor<U> for T
where U: FromColor<T>,

Source§

fn into_color(self) -> U

Convert into T with values clamped to the color defined bounds Read more
Source§

impl<T, U> IntoColorUnclamped<U> for T
where U: FromColorUnclamped<T>,

Source§

fn into_color_unclamped(self) -> U

Convert into T. The resulting color might be invalid in its color space Read more
Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> IntoMaybeErased for T
where T: RenderHtml,

§

type Output = T

The type of the output.
§

fn into_maybe_erased(self) -> <T as IntoMaybeErased>::Output

Converts the view into a type-erased view if in erased mode.
§

impl<T> IntoRender for T
where T: Render,

§

type Output = T

The renderable type into which this type can be converted.
§

fn into_render(self) -> <T as IntoRender>::Output

Consumes this value, transforming it into the renderable type.
§

impl<E, T, Request> IntoReq<DeleteUrl, Request, E> for T
where Request: ClientReq<E>, T: Serialize + Send, E: FromServerFnError,

§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
§

impl<E, T, Request> IntoReq<GetUrl, Request, E> for T
where Request: ClientReq<E>, T: Serialize + Send, E: FromServerFnError,

§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
§

impl<E, T, Encoding, Request> IntoReq<Patch<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
§

impl<E, T, Request> IntoReq<PatchUrl, Request, E> for T
where Request: ClientReq<E>, T: Serialize + Send, E: FromServerFnError,

§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
§

impl<E, T, Encoding, Request> IntoReq<Post<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
§

impl<E, T, Request> IntoReq<PostUrl, Request, E> for T
where Request: ClientReq<E>, T: Serialize + Send, E: FromServerFnError,

§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
§

impl<E, T, Encoding, Request> IntoReq<Put<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
§

impl<E, T, Request> IntoReq<PutUrl, Request, E> for T
where Request: ClientReq<E>, T: Serialize + Send, E: FromServerFnError,

§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
§

impl<E, Response, Encoding, T> IntoRes<Patch<Encoding>, Response, E> for T
where Response: TryRes<E>, Encoding: Encodes<T>, E: FromServerFnError + Send, T: Send,

§

async fn into_res(self) -> Result<Response, E>

Attempts to serialize the output into an HTTP response.
§

impl<E, Response, Encoding, T> IntoRes<Post<Encoding>, Response, E> for T
where Response: TryRes<E>, Encoding: Encodes<T>, E: FromServerFnError + Send, T: Send,

§

async fn into_res(self) -> Result<Response, E>

Attempts to serialize the output into an HTTP response.
§

impl<E, Response, Encoding, T> IntoRes<Put<Encoding>, Response, E> for T
where Response: TryRes<E>, Encoding: Encodes<T>, E: FromServerFnError + Send, T: Send,

§

async fn into_res(self) -> Result<Response, E>

Attempts to serialize the output into an HTTP response.
Source§

impl<T> IntoStimulus<T> for T

Source§

fn into_stimulus(self) -> T

Converts self into T, while performing the appropriate scaling, rounding and clamping.
§

impl<T> IntoView for T
where T: Render + RenderHtml + Send,

§

fn into_view(self) -> View<T>

Wraps the inner type.
Source§

impl<T> PathExt for T
where T: AsRef<Path>,

Source§

const PATH_SEPARATOR: char = '/'

Source§

fn as_slash_str(&self) -> String

Source§

fn same_fs_as<P>(&self, other: &P) -> bool
where P: AsRef<Path>,

Source§

fn rename_safe<P>(&self, target: &P) -> Result<(), Report>
where P: AsRef<Path>,

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Metadata = ()

The type for metadata in pointers and references to Self.
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T> SerializableKey for T

§

fn ser_key(&self) -> String

Serializes the key to a unique string. Read more
§

impl<T> StorageAccess<T> for T

§

fn as_borrowed(&self) -> &T

Borrows the value.
§

fn into_taken(self) -> T

Takes the value.
Source§

impl<T> ToHex for T
where T: AsRef<[u8]>,

Source§

fn encode_hex<U>(&self) -> U
where U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case letters are used (e.g. f9b4ca)
Source§

fn encode_hex_upper<U>(&self) -> U
where U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case letters are used (e.g. F9B4CA)
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl<T> ToStringFallible for T
where T: Display,

§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

Source§

impl<T, C> TryComponentsInto<C> for T
where C: TryFromComponents<T>,

Source§

type Error = <C as TryFromComponents<T>>::Error

The error for when try_into_colors fails to cast.
Source§

fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>

Try to cast this collection of color components into a collection of colors. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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<T, U> TryIntoColor<U> for T
where U: TryFromColor<T>,

Source§

fn try_into_color(self) -> Result<U, OutOfBounds<U>>

Convert into T, returning ok if the color is inside of its defined range, otherwise an OutOfBounds error is returned which contains the unclamped color. Read more
Source§

impl<C, U> UintsFrom<C> for U
where C: IntoUints<U>,

Source§

fn uints_from(colors: C) -> U

Cast a collection of colors into a collection of unsigned integers.
Source§

impl<C, U> UintsInto<C> for U
where C: FromUints<U>,

Source§

fn uints_into(self) -> C

Cast this collection of unsigned integers into a collection of colors.
§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> CondSerialize for T
where T: Serialize,

Source§

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

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> Formattable for T
where T: Deref, <T as Deref>::Target: Formattable,

§

impl<T> Fruit for T
where T: Send + Downcast,

§

impl<T> Parsable for T
where T: Deref, <T as Deref>::Target: Parsable,