1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! Cloud Vision integration for [Flows.network](https://flows.network)
//!
//! We only support `text_detection` for now.
//!
//! To get started, let's write a very tiny flow function.
//!
//! ```rust
//! use google_cloud_service::cloud_vision::text_detection;
//! use lambda_flows::{request_received, send_response};
//!
//! #[no_mangle]
//! pub fn run() {
//! request_received(|_qry, body| {
//! let text = text_detection::text_detection(String::from_utf8(body).unwrap());
//! match text {
//! Ok(r) => send_response(
//! 200,
//! vec![(
//! String::from("content-type"),
//! String::from("text/plain; charset=UTF-8"),
//! )],
//! r.as_bytes().to_vec(),
//! ),
//! Err(e) => send_response(
//! 500,
//! vec![(
//! String::from("content-type"),
//! String::from("text/plain; charset=UTF-8"),
//! )],
//! e.as_bytes().to_vec(),
//! ),
//! }
//! });
//! }
//!
//! ```
//!
//! When the Lambda request is received, detect the text using [text_detection].