pub struct GetDocumentText;Expand description
Get Document Text operation
Retrieves the full text content of a document by its ID. The document must have been stored with text storage enabled.
§Context Requirements
- Context must have an initialized index
- Index must be configured with text storage enabled
- Document must exist in the index
§Example
use shardex::api::{ShardexContext, GetDocumentTextParams};
use shardex::api::operations::GetDocumentText;
use shardex::{DocumentId};
use apithing::ApiOperation;
let doc_id = DocumentId::from_raw(1);
let params = GetDocumentTextParams::new(doc_id);
// let text = GetDocumentText::execute(&mut context, ¶ms)?;
// println!("Document text: {}", text);Trait Implementations§
Source§impl ApiOperation<ShardexContext, GetDocumentTextParams> for GetDocumentText
impl ApiOperation<ShardexContext, GetDocumentTextParams> for GetDocumentText
Source§type Error = ShardexError
type Error = ShardexError
The error type returned when an operation fails.
Source§fn execute(
context: &mut ShardexContext,
parameters: &GetDocumentTextParams,
) -> Result<Self::Output, Self::Error>
fn execute( context: &mut ShardexContext, parameters: &GetDocumentTextParams, ) -> Result<Self::Output, Self::Error>
Execute the API operation with the given context and properties.
Auto Trait Implementations§
impl Freeze for GetDocumentText
impl RefUnwindSafe for GetDocumentText
impl Send for GetDocumentText
impl Sync for GetDocumentText
impl Unpin for GetDocumentText
impl UnwindSafe for GetDocumentText
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
Source§impl<T, C, P> Execute<C, P> for Twhere
T: ApiOperation<C, P>,
impl<T, C, P> Execute<C, P> for Twhere
T: ApiOperation<C, P>,
Source§type Output = <T as ApiOperation<C, P>>::Output
type Output = <T as ApiOperation<C, P>>::Output
The type returned by a successful operation execution.
Source§type Error = <T as ApiOperation<C, P>>::Error
type Error = <T as ApiOperation<C, P>>::Error
The error type returned when an operation fails.
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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