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 { /* private fields */ }
Implementations
Source§impl<T> Arc<T>
impl<T> Arc<T>
Sourcepub fn new_leaked(data: T) -> Arc<T>
pub fn new_leaked(data: T) -> Arc<T>
Construct an intentionally-leaked arc.
Sourcepub fn into_raw(this: Arc<T>) -> *const T
pub fn into_raw(this: Arc<T>) -> *const T
Convert the Arc
Note: This returns a pointer to the data T, which is offset in the allocation.
Sourcepub unsafe fn from_raw(ptr: *const T) -> Arc<T>
pub unsafe fn from_raw(ptr: *const T) -> Arc<T>
Reconstruct the Arc
Note: This raw pointer will be offset in the allocation and must be preceded by the atomic count.
Sourcepub unsafe fn from_raw_addrefed(ptr: *const T) -> Arc<T>
pub unsafe fn from_raw_addrefed(ptr: *const T) -> Arc<T>
Like from_raw, but returns an addrefed arc instead.
Sourcepub unsafe fn new_static<F>(alloc: F, data: T) -> Arc<T>
pub unsafe fn new_static<F>(alloc: F, data: T) -> Arc<T>
Create a new static Arcalloc
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.
Sourcepub fn borrow_arc<'a>(&'a self) -> ArcBorrow<'a, T>
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§impl<T> Arc<T>where
T: ?Sized,
impl<T> Arc<T>where
T: ?Sized,
Sourcepub fn mark_as_intentionally_leaked(&self)
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§impl<T> Arc<T>where
T: Clone,
impl<T> Arc<T>where
T: Clone,
Sourcepub fn make_mut(this: &mut Arc<T>) -> &mut T
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.
Trait Implementations§
Source§impl Parse for InitialValue
impl Parse for InitialValue
Source§fn parse<'i, 't>(
context: &ParserContext<'_>,
input: &mut Parser<'i, 't>,
) -> Result<Self, ParseError<'i>>
fn parse<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't>, ) -> Result<Self, ParseError<'i>>
Source§impl<'de, T> Deserialize<'de> for Arc<T>where
T: Deserialize<'de>,
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>,
fn deserialize<D>(
deserializer: D,
) -> Result<Arc<T>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl<T> MallocConditionalShallowSizeOf for Arc<T>
impl<T> MallocConditionalShallowSizeOf for Arc<T>
Source§fn conditional_shallow_size_of(&self, ops: &mut MallocSizeOfOps) -> usize
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,
impl<T> MallocConditionalSizeOf for Arc<T>where
T: MallocSizeOf,
Source§fn conditional_size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn conditional_size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Source§impl<T> MallocUnconditionalShallowSizeOf for Arc<T>
impl<T> MallocUnconditionalShallowSizeOf for Arc<T>
Source§fn unconditional_shallow_size_of(&self, ops: &mut MallocSizeOfOps) -> usize
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,
impl<T> MallocUnconditionalSizeOf for Arc<T>where
T: MallocSizeOf,
Source§fn unconditional_size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn unconditional_size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Source§impl<T> Ord for Arc<T>
impl<T> Ord for Arc<T>
Source§impl<T> PartialOrd for Arc<T>where
T: PartialOrd + ?Sized,
impl<T> PartialOrd for Arc<T>where
T: PartialOrd + ?Sized,
Source§impl<T> Serialize for Arc<T>where
T: Serialize,
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,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Source§impl<T> SpecifiedValueInfo for Arc<T>where
T: SpecifiedValueInfo,
impl<T> SpecifiedValueInfo for Arc<T>where
T: SpecifiedValueInfo,
Source§const SUPPORTED_TYPES: u8 = T::SUPPORTED_TYPES
const SUPPORTED_TYPES: u8 = T::SUPPORTED_TYPES
Source§impl<T> ToComputedValue for Arc<T>where
T: ToComputedValue<ComputedValue = T>,
impl<T> ToComputedValue for Arc<T>where
T: ToComputedValue<ComputedValue = T>,
Source§type ComputedValue = Arc<T>
type ComputedValue = Arc<T>
Source§fn to_computed_value(&self, _: &Context<'_>) -> Self
fn to_computed_value(&self, _: &Context<'_>) -> Self
Context
.