pub trait Resolve {
type Content: Clone;
// Required methods
fn find_by_id(
&self,
content: &Self::Content,
id: &str,
) -> Result<(usize, usize)>;
fn find_by_id_inclusive(
&self,
content: &Self::Content,
id: &str,
) -> Result<(usize, usize)>;
fn find_by_pointer(
&self,
content: &Self::Content,
pointer: &str,
) -> Result<(usize, usize)>;
fn replace(
&self,
content: &mut Self::Content,
start: usize,
end: usize,
replacement: &str,
);
fn insert(&self, content: &mut Self::Content, pos: usize, text: &str);
fn delete(&self, content: &mut Self::Content, start: usize, end: usize);
fn to_string(&self, content: &Self::Content) -> String;
fn from_string(&self, s: &str) -> Self::Content;
}Expand description
Content resolution — how to find and replace targeted regions.
Required Associated Types§
Required Methods§
fn find_by_id( &self, content: &Self::Content, id: &str, ) -> Result<(usize, usize)>
fn find_by_id_inclusive( &self, content: &Self::Content, id: &str, ) -> Result<(usize, usize)>
fn find_by_pointer( &self, content: &Self::Content, pointer: &str, ) -> Result<(usize, usize)>
fn replace( &self, content: &mut Self::Content, start: usize, end: usize, replacement: &str, )
fn insert(&self, content: &mut Self::Content, pos: usize, text: &str)
fn delete(&self, content: &mut Self::Content, start: usize, end: usize)
fn to_string(&self, content: &Self::Content) -> String
fn from_string(&self, s: &str) -> Self::Content
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".