pub type InitialValue = Arc<SpecifiedValue>;
Expand description

Specifies the initial value of the custom property registration represented by the @property rule, controlling the property’s initial value.

The SpecifiedValue is wrapped in an Arc to avoid copying when using it.

Aliased Type§

struct InitialValue {
    pub(crate) p: NonNull<ArcInner<VariableValue>>,
    pub(crate) phantom: PhantomData<VariableValue>,
}

Fields§

§p: NonNull<ArcInner<VariableValue>>§phantom: PhantomData<VariableValue>

Implementations§

source§

impl<T> Arc<T>

source

pub fn new(data: T) -> Arc<T>

Construct an Arc<T>

source

pub fn new_leaked(data: T) -> Arc<T>

Construct an intentionally-leaked arc.

source

pub fn into_raw(this: Arc<T>) -> *const T

Convert the Arc to a raw pointer, suitable for use across FFI

Note: This returns a pointer to the data T, which is offset in the allocation.

source

pub unsafe fn from_raw(ptr: *const T) -> Arc<T>

Reconstruct the Arc from a raw pointer obtained from into_raw()

Note: This raw pointer will be offset in the allocation and must be preceded by the atomic count.

source

pub unsafe fn from_raw_addrefed(ptr: *const T) -> Arc<T>

Like from_raw, but returns an addrefed arc instead.

source

pub unsafe fn new_static<F>(alloc: F, data: T) -> Arc<T>where F: FnOnce(Layout) -> *mut u8,

Create a new static Arc (one that won’t reference count the object) and place it in the allocation provided by the specified alloc function.

alloc must return a pointer into a static allocation suitable for storing data with the Layout passed into it. The pointer returned by alloc will not be freed.

source

pub fn borrow_arc<'a>(&'a self) -> ArcBorrow<'a, T>

Produce a pointer to the data that can be converted back to an Arc. This is basically an &Arc<T>, without the extra indirection. It has the benefits of an &T but also knows about the underlying refcount and can be converted into more Arc<T>s if necessary.

source

pub fn heap_ptr(&self) -> *const c_void

Returns the address on the heap of the Arc itself – not the T within it – for memory reporting.

If this is a static reference, this returns null.

source§

impl<T> Arc<T>where T: ?Sized,

source

pub fn mark_as_intentionally_leaked(&self)

Marks this Arc as intentionally leaked for the purposes of refcount logging.

It’s a logic error to call this more than once, but it’s not unsafe, as it’d just report negative leaks.

source

pub fn ptr_eq(this: &Arc<T>, other: &Arc<T>) -> bool

Test pointer equality between the two Arcs, i.e. they must be the same allocation

source

pub fn raw_ptr(&self) -> *const c_void

Returns a raw ptr to the underlying allocation.

source§

impl<T> Arc<T>where T: Clone,

source

pub fn make_mut(this: &mut Arc<T>) -> &mut T

Makes a mutable reference to the Arc, cloning if necessary

This is functionally equivalent to Arc::make_mut from the standard library.

If this Arc is uniquely owned, make_mut() will provide a mutable reference to the contents. If not, make_mut() will create a new Arc with a copy of the contents, update this to point to it, and provide a mutable reference to its contents.

This is useful for implementing copy-on-write schemes where you wish to avoid copying things if your Arc is not shared.

source§

impl<T> Arc<T>where T: ?Sized,

source

pub fn get_mut(this: &mut Arc<T>) -> Option<&mut T>

Provides mutable access to the contents if the Arc is uniquely owned.

source

pub fn is_static(&self) -> bool

Whether or not the Arc is a static reference.

source

pub fn is_unique(&self) -> bool

Whether or not the Arc is uniquely owned (is the refcount 1?) and not a static reference.

Trait Implementations§

source§

impl<T> AsRef<T> for Arc<T>where T: ?Sized,

source§

fn as_ref(&self) -> &T

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

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> Clone for Arc<T>where T: ?Sized,

source§

fn clone(&self) -> Arc<T>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<T> Debug for Arc<T>where T: Debug + ?Sized,

source§

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

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

impl<T> Default for Arc<T>where T: Default,

source§

fn default() -> Arc<T>

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

impl<T> Deref for Arc<T>where T: ?Sized,

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &T

Dereferences the value.
source§

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

source§

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

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

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

source§

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

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

impl<T> Drop for Arc<T>where T: ?Sized,

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<T> From<T> for Arc<T>

source§

fn from(t: T) -> Arc<T>

Converts to this type from the input type.
source§

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

source§

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

impl<T> MallocConditionalShallowSizeOf for Arc<T>

source§

fn conditional_shallow_size_of(&self, ops: &mut MallocSizeOfOps) -> usize

conditional_size_of combined with shallow_size_of.
source§

impl<T> MallocConditionalSizeOf for Arc<T>where T: MallocSizeOf,

source§

fn conditional_size_of(&self, ops: &mut MallocSizeOfOps) -> usize

Measure the heap usage of all heap-allocated descendant structures, but not the space taken up by the value itself, and only if that heap usage hasn’t already been measured.
source§

impl<T> MallocUnconditionalShallowSizeOf for Arc<T>

source§

fn unconditional_shallow_size_of(&self, ops: &mut MallocSizeOfOps) -> usize

unconditional_size_of combined with shallow_size_of.
source§

impl<T> MallocUnconditionalSizeOf for Arc<T>where T: MallocSizeOf,

source§

fn unconditional_size_of(&self, ops: &mut MallocSizeOfOps) -> usize

Measure the heap usage of all heap-allocated descendant structures, but not the space taken up by the value itself.
source§

impl<T> Ord for Arc<T>where T: Ord + ?Sized,

source§

fn cmp(&self, other: &Arc<T>) -> Ordering

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

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

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

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

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

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl Parse for InitialValue

source§

fn parse<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't> ) -> Result<Self, ParseError<'i>>

Parse a value of this type. Read more
source§

impl<T> PartialEq<Arc<T>> for Arc<T>where T: PartialEq<T> + ?Sized,

source§

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

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &Arc<T>) -> bool

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

impl<T> PartialOrd<Arc<T>> for Arc<T>where T: PartialOrd<T> + ?Sized,

source§

fn partial_cmp(&self, other: &Arc<T>) -> Option<Ordering>

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

fn lt(&self, other: &Arc<T>) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, other: &Arc<T>) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, other: &Arc<T>) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, other: &Arc<T>) -> bool

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

impl<T> Pointer for Arc<T>where T: ?Sized,

source§

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

Formats the value using the given formatter.
source§

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

source§

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

impl<T> SpecifiedValueInfo for Arc<T>where T: SpecifiedValueInfo,

source§

const SUPPORTED_TYPES: u8 = T::SUPPORTED_TYPES

Supported CssTypes by the given value type. Read more
source§

fn collect_completion_keywords(f: &mut dyn FnMut(&[&'static str]))

Collect value starting words for the given specified value type. This includes keyword and function names which can appear at the beginning of a value of this type. Read more
source§

impl<T> ToComputedValue for Arc<T>where T: ToComputedValue<ComputedValue = T>,

§

type ComputedValue = Arc<T>

The computed value type we’re going to be converted to.
source§

fn to_computed_value(&self, _: &Context<'_>) -> Self

Convert a specified value to a computed value, using itself and the data inside the Context.
source§

fn from_computed_value(computed: &Self) -> Self

Convert a computed value to specified value form. Read more
source§

impl<T> ToCss for Arc<T>where T: ToCss + ?Sized,

source§

fn to_css<W>(&self, dest: &mut CssWriter<'_, W>) -> Result<(), Error>where W: Write,

Serialize self in CSS syntax, writing to dest.
source§

fn to_css_string(&self) -> String

Serialize self in CSS syntax and return a string. Read more
source§

impl<T> ToResolvedValue for Arc<T>where T: ToResolvedValue<ResolvedValue = T>,

§

type ResolvedValue = Arc<T>

The resolved value type we’re going to be converted to.
source§

fn to_resolved_value(self, _: &Context<'_>) -> Self

Convert a resolved value to a resolved value.
source§

fn from_resolved_value(resolved: Self) -> Self

Convert a resolved value to resolved value form.
source§

impl<T> ToShmem for Arc<T>where T: ToShmem,

source§

fn to_shmem( &self, builder: &mut SharedMemoryBuilder ) -> Result<ManuallyDrop<Arc<T>>, String>

Clones this value into a form suitable for writing into a SharedMemoryBuilder. Read more
source§

impl<T> CloneStableDeref for Arc<T>where T: ?Sized,

source§

impl<T> Eq for Arc<T>where T: Eq + ?Sized,

source§

impl<T> Send for Arc<T>where T: Sync + Send + ?Sized,

source§

impl<T> StableDeref for Arc<T>where T: ?Sized,

source§

impl<T> Sync for Arc<T>where T: Sync + Send + ?Sized,