pub struct VisionConfig {
pub enabled: bool,
pub configs: Option<VisionDetail>,
pub variable_selector: Option<Selector>,
pub detail: Option<String>,
}Expand description
vision: {enabled, configs: {variable_selector, detail}} (or the fields inline).
Fields§
§enabled: bool§configs: Option<VisionDetail>§variable_selector: Option<Selector>§detail: Option<String>Implementations§
Source§impl VisionConfig
impl VisionConfig
Sourcepub fn image_parts(
&self,
pool: &VariablePool,
) -> Result<Vec<ContentPart>, NodeError>
pub fn image_parts( &self, pool: &VariablePool, ) -> Result<Vec<ContentPart>, NodeError>
Image parts for the configured files, each with the file’s own URL.
With the vision-preparer feature, nodes use prepared_image_parts,
which also lets the host check and resize the images.
Sourcepub fn prepared_image_parts<'a>(
&'a self,
ctx: &'a NodeContext,
) -> BoxFuture<'a, Result<Vec<ContentPart>, NodeError>>
pub fn prepared_image_parts<'a>( &'a self, ctx: &'a NodeContext, ) -> BoxFuture<'a, Result<Vec<ContentPart>, NodeError>>
Image parts for the configured files, passed through the host’s
ImagePreparer when one is registered: it checks, bounds and
re-encodes each image and can read images that live in host storage.
Without a preparer this is VisionConfig::image_parts.
An image the preparer refuses fails the node. It is never sent as it was.
pub fn selectors(&self) -> Vec<Selector>
Trait Implementations§
Source§impl Clone for VisionConfig
impl Clone for VisionConfig
Source§impl Debug for VisionConfig
impl Debug for VisionConfig
Source§impl Default for VisionConfig
impl Default for VisionConfig
Source§impl<'de> Deserialize<'de> for VisionConfig
impl<'de> Deserialize<'de> for VisionConfig
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
Auto Trait Implementations§
impl Forget for VisionConfig
impl Freeze for VisionConfig
impl Move for VisionConfig
impl RefUnwindSafe for VisionConfig
impl Send for VisionConfig
impl Sync for VisionConfig
impl Unpin for VisionConfig
impl UnsafeUnpin for VisionConfig
impl UnwindSafe for VisionConfig
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