pub struct Rope { /* private fields */ }Expand description
An efficient structure for sharing bytes/strings between multiple sources.
Cloning a Rope is extremely cheap (Arc and usize), and sharing the contents of one Rope can be done by just cloning an Arc.
Ropes are immutable, in order to construct one see RopeBuilder.
Implementations§
Source§impl Rope
impl Rope
Sourcepub fn cell(self) -> Vc<Self>
pub fn cell(self) -> Vc<Self>
Places a value in a cell of the current task.
Cell is selected based on the value type and call order of cell.
Sourcepub fn resolved_cell(self) -> ResolvedVc<Self>
pub fn resolved_cell(self) -> ResolvedVc<Self>
Places a value in a cell of the current task. Returns a
[ResolvedVc][turbo_tasks::ResolvedVc].
Cell is selected based on the value type and call order of cell.
Trait Implementations§
Source§impl AddAssign<&Rope> for RopeBuilder
impl AddAssign<&Rope> for RopeBuilder
Source§fn add_assign(&mut self, rhs: &Rope)
fn add_assign(&mut self, rhs: &Rope)
+= operation. Read moreSource§impl<'de, __Context> BorrowDecode<'de, __Context> for Rope
impl<'de, __Context> BorrowDecode<'de, __Context> for Rope
Source§fn borrow_decode<D: BorrowDecoder<'de, Context = __Context>>(
decoder: &mut D,
) -> Result<Self, DecodeError>
fn borrow_decode<D: BorrowDecoder<'de, Context = __Context>>( decoder: &mut D, ) -> Result<Self, DecodeError>
Source§impl DeterministicHash for Rope
impl DeterministicHash for Rope
Source§fn deterministic_hash<H: DeterministicHasher>(&self, state: &mut H)
fn deterministic_hash<H: DeterministicHasher>(&self, state: &mut H)
Ropes with similar contents hash the same, regardless of their structure.
Source§impl Encode for Rope
Encode as a len + raw bytes format using the encoder’s bincode::enc::write::Writer. Encoding
Rope::to_bytes instead would be easier, but would require copying to an intermediate buffer.
impl Encode for Rope
Encode as a len + raw bytes format using the encoder’s bincode::enc::write::Writer. Encoding
Rope::to_bytes instead would be easier, but would require copying to an intermediate buffer.
This len + bytes format is similar to how bincode would normally encode a &[u8]:
https://docs.rs/bincode/latest/bincode/spec/index.html#collections
Source§impl Ord for Rope
impl Ord for Rope
Source§impl PartialOrd for Rope
impl PartialOrd for Rope
Source§impl TraceRawVcs for Rope
impl TraceRawVcs for Rope
fn trace_raw_vcs(&self, __context__: &mut TraceRawVcsContext)
fn get_raw_vcs(&self) -> Vec<RawVc>
Source§impl ValueDebugFormat for Rope
impl ValueDebugFormat for Rope
fn value_debug_format<'a>(&'a self, depth: usize) -> ValueDebugFormatString<'a>
impl Eq for Rope
impl NonLocalValue for Rope
impl OperationValue for Rope
impl Upcast<Box<dyn ValueDebug>> for Rope
impl UpcastStrict<Box<dyn ValueDebug>> for Rope
Auto Trait Implementations§
impl Freeze for Rope
impl RefUnwindSafe for Rope
impl Send for Rope
impl Sync for Rope
impl Unpin for Rope
impl UnwindSafe for Rope
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<T> DynPartialEq for T
impl<T> DynPartialEq for T
fn dyn_partial_eq(&self, other: &(dyn Any + 'static)) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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