Struct hypothesis::annotations::InputAnnotation [−][src]
Struct to create annotations
All fields except uri are optional, i.e. leave as default.
Example
use hypothesis::annotations::{InputAnnotation, Target, Selector}; // A simple annotation let annotation_simple = InputAnnotation::builder() .uri("https://www.example.com") .text("My new annotation").build()?; // A complex annotation let annotation_complex = InputAnnotation::builder() .uri("https://www.example.com") .text("this is a comment") .target(Target::builder().source("https://www.example.com") .selector(vec![Selector::new_quote("exact text in website to highlight", "prefix of text", "suffix of text")]).build()?) .tags(vec!["tag1".into(), "tag2".into()]) .build()?;
Fields
uri: String
URI that this annotation is attached to.
Can be a URL (a web page address) or a URN representing another kind of resource such as DOI (Digital Object Identifier) or a PDF fingerprint.
text: String
Annotation text / comment given by user
This is NOT the selected text on the web-page
Tags attached to the annotation
document: Option<Document>
Further metadata about the target document
group: String
The unique identifier for the annotation’s group.
If an annotation is a reply to another
annotation (see references
), this field will be ignored —
replies belong to the same group as their parent annotations.
target: Target
Which part of the document does the annotation target?
If left as default then the annotation is linked to the whole page.
references: Vec<String>
Annotation IDs for any annotations this annotation references (e.g. is a reply to)
Implementations
impl InputAnnotation
[src]
pub fn builder() -> InputAnnotationBuilder
[src]
Trait Implementations
impl Clone for InputAnnotation
[src]
fn clone(&self) -> InputAnnotation
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for InputAnnotation
[src]
impl Default for InputAnnotation
[src]
fn default() -> InputAnnotation
[src]
impl PartialEq<InputAnnotation> for InputAnnotation
[src]
fn eq(&self, other: &InputAnnotation) -> bool
[src]
fn ne(&self, other: &InputAnnotation) -> bool
[src]
impl Serialize for InputAnnotation
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructOpt for InputAnnotation
[src]
fn clap<'a, 'b>() -> App<'a, 'b>
[src]
fn from_clap(matches: &ArgMatches<'_>) -> Self
[src]
pub fn from_args() -> Self
[src]
pub fn from_args_safe() -> Result<Self, Error>
[src]
pub fn from_iter<I>(iter: I) -> Self where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
[src]
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
pub fn from_iter_safe<I>(iter: I) -> Result<Self, Error> where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
[src]
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
impl StructOptInternal for InputAnnotation
[src]
fn augment_clap<'a, 'b>(app: App<'a, 'b>) -> App<'a, 'b>
[src]
fn is_subcommand() -> bool
[src]
pub fn from_subcommand(
_sub: (&'b str, Option<&'b ArgMatches<'a>>)
) -> Option<Self>
[src]
_sub: (&'b str, Option<&'b ArgMatches<'a>>)
) -> Option<Self>
impl StructuralPartialEq for InputAnnotation
[src]
Auto Trait Implementations
impl RefUnwindSafe for InputAnnotation
impl Send for InputAnnotation
impl Sync for InputAnnotation
impl Unpin for InputAnnotation
impl UnwindSafe for InputAnnotation
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<D> OwoColorize for D
pub fn fg<C>(&'a self) -> FgColorDisplay<'a, C, Self> where
C: Color,
C: Color,
pub fn bg<C>(&'a self) -> BgColorDisplay<'a, C, Self> where
C: Color,
C: Color,
pub fn black(&'a self) -> FgColorDisplay<'a, Black, Self>
pub fn on_black(&'a self) -> BgColorDisplay<'a, Black, Self>
pub fn red(&'a self) -> FgColorDisplay<'a, Red, Self>
pub fn on_red(&'a self) -> BgColorDisplay<'a, Red, Self>
pub fn green(&'a self) -> FgColorDisplay<'a, Green, Self>
pub fn on_green(&'a self) -> BgColorDisplay<'a, Green, Self>
pub fn yellow(&'a self) -> FgColorDisplay<'a, Yellow, Self>
pub fn on_yellow(&'a self) -> BgColorDisplay<'a, Yellow, Self>
pub fn blue(&'a self) -> FgColorDisplay<'a, Blue, Self>
pub fn on_blue(&'a self) -> BgColorDisplay<'a, Blue, Self>
pub fn magenta(&'a self) -> FgColorDisplay<'a, Magenta, Self>
pub fn on_magenta(&'a self) -> BgColorDisplay<'a, Magenta, Self>
pub fn purple(&'a self) -> FgColorDisplay<'a, Magenta, Self>
pub fn on_purple(&'a self) -> BgColorDisplay<'a, Magenta, Self>
pub fn cyan(&'a self) -> FgColorDisplay<'a, Cyan, Self>
pub fn on_cyan(&'a self) -> BgColorDisplay<'a, Cyan, Self>
pub fn white(&'a self) -> FgColorDisplay<'a, White, Self>
pub fn on_white(&'a self) -> BgColorDisplay<'a, White, Self>
pub fn bright_black(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
pub fn on_bright_black(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
pub fn bright_red(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
pub fn on_bright_red(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
pub fn bright_green(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
pub fn on_bright_green(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
pub fn bright_yellow(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
pub fn on_bright_yellow(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
pub fn bright_blue(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
pub fn on_bright_blue(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
pub fn bright_magenta(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
pub fn on_bright_magenta(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
pub fn bright_purple(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
pub fn on_bright_purple(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
pub fn bright_cyan(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
pub fn on_bright_cyan(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
pub fn bright_white(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
pub fn on_bright_white(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
pub fn bold(&'a self) -> BoldDisplay<'a, Self>
pub fn dimmed(&'a self) -> DimDisplay<'a, Self>
pub fn italic(&'a self) -> ItalicDisplay<'a, Self>
pub fn underline(&'a self) -> UnderlineDisplay<'a, Self>
pub fn blink(&'a self) -> BlinkDisplay<'a, Self>
pub fn blink_fast(&'a self) -> BlinkFastDisplay<'a, Self>
pub fn reversed(&'a self) -> ReversedDisplay<'a, Self>
pub fn hidden(&'a self) -> HiddenDisplay<'a, Self>
pub fn strikethrough(&'a self) -> StrikeThroughDisplay<'a, Self>
pub fn color<Color>(
&'a self,
color: Color
) -> FgDynColorDisplay<'a, Color, Self> where
Color: DynColor,
&'a self,
color: Color
) -> FgDynColorDisplay<'a, Color, Self> where
Color: DynColor,
pub fn on_color<Color>(
&'a self,
color: Color
) -> BgDynColorDisplay<'a, Color, Self> where
Color: DynColor,
&'a self,
color: Color
) -> BgDynColorDisplay<'a, Color, Self> where
Color: DynColor,
pub fn truecolor(
&'a self,
r: u8,
g: u8,
b: u8
) -> FgDynColorDisplay<'a, Rgb, Self>
&'a self,
r: u8,
g: u8,
b: u8
) -> FgDynColorDisplay<'a, Rgb, Self>
pub fn on_truecolor(
&'a self,
r: u8,
g: u8,
b: u8
) -> BgDynColorDisplay<'a, Rgb, Self>
&'a self,
r: u8,
g: u8,
b: u8
) -> BgDynColorDisplay<'a, Rgb, Self>
pub fn style(&self, style: Style) -> Styled<&Self>
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,