pub enum DashLength {
Length(Length),
Dot,
}Expand description
One entry of a stroke’s dash array: a length, or "dot" (a dash as long as
the stroke is thick).
Carries no typwire-type tag: Typst represents a .dash field as a plain
dictionary, so this nests inside Stroke via ordinary Serde.
See the Typst documentation.
§Examples
use typwire::{DashLength, initiate_protocol};
initiate_protocol!();
#[typwire::export]
fn is_dot(entry: DashLength) -> Result<bool, String> {
Ok(matches!(entry, DashLength::Dot))
}Variants§
Trait Implementations§
Source§impl Clone for DashLength
impl Clone for DashLength
Source§impl Debug for DashLength
impl Debug for DashLength
Source§impl<'de> Deserialize<'de> for DashLength
impl<'de> Deserialize<'de> for DashLength
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for DashLength
impl Serialize for DashLength
impl Typwire for DashLength
Auto Trait Implementations§
impl Forget for DashLength
impl Freeze for DashLength
impl Move for DashLength
impl RefUnwindSafe for DashLength
impl Send for DashLength
impl Sync for DashLength
impl Unpin for DashLength
impl UnsafeUnpin for DashLength
impl UnwindSafe for DashLength
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
Mutably borrows from an owned value. Read more