Struct hypothesis::annotations::InputAnnotationBuilder[][src]

pub struct InputAnnotationBuilder { /* fields omitted */ }

Builder for InputAnnotation.

Implementations

impl InputAnnotationBuilder[src]

pub fn uri<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self[src]

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.

pub fn text<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self[src]

Annotation text / comment given by user

This is NOT the selected text on the web-page

pub fn tags(&mut self, value: Vec<String>) -> &mut Self[src]

Tags attached to the annotation

pub fn document(&mut self, value: Document) -> &mut Self[src]

Further metadata about the target document

pub fn group<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self[src]

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.

pub fn target(&mut self, value: Target) -> &mut Self[src]

Which part of the document does the annotation target?

If left as default then the annotation is linked to the whole page.

pub fn references(&mut self, value: Vec<String>) -> &mut Self[src]

Annotation IDs for any annotations this annotation references (e.g. is a reply to)

pub fn builder(&self) -> Result<InputAnnotation, String>[src]

Builds a new InputAnnotation.

Errors

If a required field has not been initialized.

impl InputAnnotationBuilder[src]

pub fn build(&self) -> Result<InputAnnotation, HypothesisError>[src]

Builds a new InputAnnotation.

Trait Implementations

impl Clone for InputAnnotationBuilder[src]

impl Default for InputAnnotationBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<D> OwoColorize for D

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.