pub struct LayoutParsingRequest { /* private fields */ }Expand description
Request for POST /layout_parsing.
Implementations§
Source§impl LayoutParsingRequest
impl LayoutParsingRequest
Sourcepub fn new(file: impl Into<String>) -> Self
pub fn new(file: impl Into<String>) -> Self
Create a request for a URL or base64-encoded PDF/JPG/PNG input.
Sourcepub fn with_crop_images(self, enabled: bool) -> Self
pub fn with_crop_images(self, enabled: bool) -> Self
Configure cropped-image output.
Sourcepub fn with_layout_visualization(self, enabled: bool) -> Self
pub fn with_layout_visualization(self, enabled: bool) -> Self
Configure layout-visualization output.
Sourcepub fn with_page_range(self, start: u32, end: u32) -> Self
pub fn with_page_range(self, start: u32, end: u32) -> Self
Select the inclusive PDF page range.
Sourcepub fn with_start_page_id(self, start: u32) -> Self
pub fn with_start_page_id(self, start: u32) -> Self
Set only the first PDF page to parse.
Sourcepub fn with_end_page_id(self, end: u32) -> Self
pub fn with_end_page_id(self, end: u32) -> Self
Set only the last PDF page to parse.
Sourcepub fn with_request_id(self, request_id: impl Into<String>) -> Self
pub fn with_request_id(self, request_id: impl Into<String>) -> Self
Set the caller-provided request identifier.
Sourcepub fn with_user_id(self, user_id: impl Into<String>) -> Self
pub fn with_user_id(self, user_id: impl Into<String>) -> Self
Set the end-user identifier used for abuse monitoring.
Sourcepub const fn page_range(&self) -> Option<(u32, u32)>
pub const fn page_range(&self) -> Option<(u32, u32)>
Return the selected PDF page range.
Sourcepub const fn start_page_id(&self) -> Option<u32>
pub const fn start_page_id(&self) -> Option<u32>
Return the optional first PDF page.
Sourcepub const fn end_page_id(&self) -> Option<u32>
pub const fn end_page_id(&self) -> Option<u32>
Return the optional last PDF page.
Sourcepub const fn crop_images_enabled(&self) -> Option<bool>
pub const fn crop_images_enabled(&self) -> Option<bool>
Return the crop-image flag.
Sourcepub const fn layout_visualization_enabled(&self) -> Option<bool>
pub const fn layout_visualization_enabled(&self) -> Option<bool>
Return the layout-visualization flag.
Sourcepub fn request_id(&self) -> Option<&str>
pub fn request_id(&self) -> Option<&str>
Borrow the caller-provided request identifier.
Sourcepub fn validate(&self) -> ZaiResult<()>
pub fn validate(&self) -> ZaiResult<()>
Validate frozen OpenAPI numeric and identifier constraints.
Sourcepub async fn send_via(
&self,
client: &ZaiClient,
) -> ZaiResult<LayoutParsingResponse>
pub async fn send_via( &self, client: &ZaiClient, ) -> ZaiResult<LayoutParsingResponse>
Validate, send, and decode a layout-parsing response.
Trait Implementations§
Source§impl Clone for LayoutParsingRequest
impl Clone for LayoutParsingRequest
Source§fn clone(&self) -> LayoutParsingRequest
fn clone(&self) -> LayoutParsingRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LayoutParsingRequest
impl Debug for LayoutParsingRequest
Auto Trait Implementations§
impl Freeze for LayoutParsingRequest
impl RefUnwindSafe for LayoutParsingRequest
impl Send for LayoutParsingRequest
impl Sync for LayoutParsingRequest
impl Unpin for LayoutParsingRequest
impl UnsafeUnpin for LayoutParsingRequest
impl UnwindSafe for LayoutParsingRequest
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