pub struct ImageBlock {
pub source: ImageSource,
pub cache_control: Option<CacheControlEphemeral>,
}Expand description
Parameters for an image block.
Fields§
§source: ImageSourceThe source of the image.
cache_control: Option<CacheControlEphemeral>Create a cache control breakpoint at this content block.
Implementations§
Source§impl ImageBlock
impl ImageBlock
Sourcepub fn new(source: ImageSource) -> Self
pub fn new(source: ImageSource) -> Self
Create a new ImageBlock with the given source.
Sourcepub fn new_with_base64(source: Base64ImageSource) -> Self
pub fn new_with_base64(source: Base64ImageSource) -> Self
Create a new ImageBlock with a Base64 image source.
Sourcepub fn new_with_url(source: UrlImageSource) -> Self
pub fn new_with_url(source: UrlImageSource) -> Self
Create a new ImageBlock with a URL image source.
Sourcepub fn with_cache_control(self, cache_control: CacheControlEphemeral) -> Self
pub fn with_cache_control(self, cache_control: CacheControlEphemeral) -> Self
Add a cache control to this image block.
Trait Implementations§
Source§impl Clone for ImageBlock
impl Clone for ImageBlock
Source§fn clone(&self) -> ImageBlock
fn clone(&self) -> ImageBlock
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 ImageBlock
impl Debug for ImageBlock
Source§impl<'de> Deserialize<'de> for ImageBlock
impl<'de> Deserialize<'de> for ImageBlock
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<ImageBlock> for Content
impl From<ImageBlock> for Content
Source§fn from(image_block: ImageBlock) -> Self
fn from(image_block: ImageBlock) -> Self
Converts to this type from the input type.
Source§impl From<ImageBlock> for ContentBlock
impl From<ImageBlock> for ContentBlock
Source§fn from(block: ImageBlock) -> Self
fn from(block: ImageBlock) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ImageBlock
impl PartialEq for ImageBlock
Source§fn eq(&self, other: &ImageBlock) -> bool
fn eq(&self, other: &ImageBlock) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ImageBlock
impl Serialize for ImageBlock
impl StructuralPartialEq for ImageBlock
Auto Trait Implementations§
impl Freeze for ImageBlock
impl RefUnwindSafe for ImageBlock
impl Send for ImageBlock
impl Sync for ImageBlock
impl Unpin for ImageBlock
impl UnsafeUnpin for ImageBlock
impl UnwindSafe for ImageBlock
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