pub struct Register {
pub text: String,
pub kind: RegisterKind,
}Expand description
The unnamed register’s contents.
text is stored exactly as it was captured — a linewise capture keeps its
trailing newline, because that newline is what makes it a line. The put
normalizes rather than the capture, so the register always reads back what
the buffer gave it.
Fields§
§text: String§kind: RegisterKindImplementations§
Source§impl Register
impl Register
pub fn new(text: impl Into<String>, kind: RegisterKind) -> Self
pub fn charwise(text: impl Into<String>) -> Self
pub fn linewise(text: impl Into<String>) -> Self
pub const fn is_linewise(&self) -> bool
Sourcepub fn replayed(&self, count: u32) -> String
pub fn replayed(&self, count: u32) -> String
The text a put of count copies should insert.
Linewise content is newline-TERMINATED before repeating, so 2p of a
register captured from a file with no trailing newline still yields two
separate lines rather than one glued pair. The capture is left alone
(see the struct note) and the normalization happens here, once, where
both put directions share it.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Register
impl<'de> Deserialize<'de> for Register
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
impl Eq for Register
Source§impl JsonSchema for Register
impl JsonSchema for Register
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreimpl StructuralPartialEq for Register
Auto Trait Implementations§
impl Freeze for Register
impl RefUnwindSafe for Register
impl Send for Register
impl Sync for Register
impl Unpin for Register
impl UnsafeUnpin for Register
impl UnwindSafe for Register
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