Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How does Calcite create the library of deno plugins

Shulou Source: shulou.com Published: 2022-06-01 08:48:45 10月27日 Update

This article mainly explains "Calcite how to create a library of deno plugins", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let Xiaobian take you to learn "Calcite how to create a library of deno plugins"!

Examples of Calcite libraries used to create deno plugins: cargo build --example sync

deno run --unstable --allow-plugin --allow-read --allow-write examples/sync.ts

cargo build --example async

deno run --unstable --allow-plugin --allow-read --allow-write examples/async.ts

tide release v0.12.0 Major changes: Added ResponseBuilder to make it easier to build Response. app.at("/").get(|_| async {

let res = Response::builder(203)

.body(json! ({ "hello": "cats! " }))

.header("X-Nori", "me-ow")

.header("X-Chashu", "meewwww");

Ok(res)

})

Server::listen By introducing a new Listener trait, it can provide various transports, and by default it has built-in implementations for TcpStream , SocketAddr, and UnixStream. let mut app = tide::new();

let listener = TlsListener::build()

.addrs("localhost:4433")

.cert(cert)

.key(key);

app.listen(listener).await?;

Also released at the same time is tide::listener::ConcurrentListener , which handles multiple transports, such as developers who want to handle IPV4 and IPV6 simultaneously. let mut app = tide::new();

let mut listener = listener::ConcurrentListener::new();

listener.add((Ipv4Addr::new(127, 0, 0, 1), 8000));

listener.add((Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1), 8000));

app.listen(listener).await?;

State must now clone. Migrate all traits using async-trait.Improvements in error handling in middleware. At this point, I believe everyone has a deeper understanding of "Calcite how to create a library of deno plugins", so let's actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!

Tags: Processing content at the same time learning practical deeper right examples interests multiple practical practical developers easy to operate methods more friends websites errors channels Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Shulou Information NVidia Docker Redmi