Skip to content

Commit

Permalink
homepage: update banner with charter, add tenets as blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed Aug 24, 2023
1 parent 3b4b3d1 commit 13b9b66
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 62 deletions.
2 changes: 1 addition & 1 deletion _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<title>{% if page.title %}{{ page.title }} | hyper{% else %}{{ site.title }}{% endif %}</title>
<meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" integrity="sha256-wLz3iY/cO4e6vKZ4zRmo4+9XDpMcgKOvv/zEU3OMlRo=" crossorigin="anonymous">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-4bw+/aepP/YC94hEpVNVgiZdgIC5+VKNBQNGCHeKRQN+PtmoHDEXuppvnDJzQIu9" crossorigin="anonymous">
<link rel="stylesheet" href="{{ "/css/main.css" | absolute_url }}">

<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
Expand Down
59 changes: 39 additions & 20 deletions _layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,53 @@
<section class="hyper-pageheader">
<div class="container">
<h1>hyper</h1>
<p>Fast and safe HTTP for the Rust language.</p>
<p>A protective and efficient HTTP library for all.</p>
<p><a href="/guides/1" class="btn hyper-getstarted">Get Started</a></p>
</div>
</section>
<section class="container">
<div class="row">
<div class="col-md-6">
<p class="lead">
<b>Note:</b> hyper is planning a stable <code>1.0</code> release in 2023.
These guides will be gradually transitioned to <code>1.0</code>, but if you're looking for
guides for <code>0.14</code> you can find them <a href="/guides/0.14">here</a>. If you'd like to
learn more about the move to <code>1.0</code>,
<a href="https://seanmonstar.com/post/680802159018803200/hyper-10-roadmap">this</a> is a good place to start.
</p>
<p class="lead">hyper is a fast HTTP implementation written in and for Rust.</p>
<ul>
<li>A <strong>Client</strong> for talking to web services.</li>
<li>A <strong>Server</strong> for building those web services.</li>
<li>Blazing <strong>fast</strong><a href="https://www.techempower.com/benchmarks/#section=data-r18&hw=ph&test=plaintext">*</a> thanks to Rust.</li>
<li>High <strong>concurrency</strong> with non-blocking sockets.</li>
<li>HTTP/1 and <strong>HTTP/2</strong> support.</li>
</ul>
<h3>The HTTP implementation for Rust</h3>
<ul>
<li>A <strong>Client</strong> for talking to web services.</li>
<li>A <strong>Server</strong> for building those web services.</li>
<li>Blazing <strong>fast</strong><a href="https://www.techempower.com/benchmarks/#section=data-r18&hw=ph&test=plaintext">*</a> thanks to Rust.</li>
<li>High <strong>concurrency</strong> with non-blocking sockets.</li>
<li>HTTP/1 and <strong>HTTP/2</strong> support.</li>
</ul>
</div>
<div class="col-md-6">
<h3>Latest: 1.0 coming soon</h3>
<p><strong>Note:</strong> hyper is planning a stable <code>1.0</code> release in 2023. These guides will be gradually transitioned to <code>1.0</code>, but if you're looking for guides for <code>0.14</code> you can find them <a href="/guides/0.14">here</a>. If you'd like to learn more about the move to <code>1.0</code>, <a href="https://seanmonstar.com/post/680802159018803200/hyper-10-roadmap">this</a> is a good place to start.</p>
</div>
</div>
<div class="col-md-6">
{{ content }}
<div class="row">
<div class="col-md-6 col-lg-4">
<h3>Open</h3>
<p>hyper is open source, always. The success of hyper depends on the health of the community building and using it. All contributions are in the open.</p>
</div>
<div class="col-md-6 col-lg-4">
<h3>Correct</h3>
<p>hyper is a memory safe and robust implementation of the HTTP specification. Memory safety is vital in a core Internet technology. Following the HTTP specifications correctly protects users. It makes the software durable to the “real world”. Where feasible, hyper enforces correct usage.</p>
</div>
<div class="col-md-6 col-lg-4">
<h3>Fast</h3>
<p>A fast experience delights users. A faster network library means a faster application, resulting in delighting our users’ users. Whether with one request, or millions.</p>
</div>
<div class="col-md-6 col-lg-4">
<h3>HTTP/*</h3>
<p>hyper is specifically focused on HTTP. Support for HTTP/1 and HTTP/2, with HTTP/3 in the works.</p>
</div>
<div class="col-md-6 col-lg-4">
<h3>Flexible</h3>
<p>hyper enables as many usecases as possible. It has no opinion on application structure, and makes few assumptions about its environment. This includes being portable to different operating systems.</p>
</div>
<div class="col-md-6 col-lg-4">
<h3>Understable</h3>
<p>hyper is no more complicated than it has to be. HTTP is not simple. It may not be as “easy” as 1-line to do everything, but it shouldn’t be “hard” to find the answers.</p>
</div>
</div>

</div>
</section>

{% include footer.html %}
Expand Down
4 changes: 2 additions & 2 deletions css/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ pre code {
margin: 2rem 0 1rem;
}

.hyper-content h3 {
h3 {
color: $primary-dim-color;
}

Expand Down Expand Up @@ -378,4 +378,4 @@ pre code {

.navbar .navbar-brand:hover {
color: $primary-highlight-color
}
}
39 changes: 0 additions & 39 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,3 @@
layout: home
---

```rust
# extern crate tokio;
# extern crate hyper;
# extern crate http_body_util;
# mod no_run {
use std::{convert::Infallible, net::SocketAddr, error::Error};
use http_body_util::Full;
use hyper::{Request, Response, body::Bytes, service::service_fn};
use hyper::server::conn::http1;
use tokio::net::TcpListener;

async fn hello(
_: Request<hyper::body::Incoming>,
) -> Result<Response<Full<Bytes>>, Infallible> {
Ok(Response::new(Full::new(Bytes::from("Hello World!"))))
}

#[tokio::main]
async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
let addr = SocketAddr::from(([127, 0, 0, 1], 3000));

let listener = TcpListener::bind(addr).await?;

loop {
let (stream, _) = listener.accept().await?;

tokio::task::spawn(async move {
if let Err(err) = http1::Builder::new()
.serve_connection(stream, service_fn(hello))
.await
{
println!("Error serving connection: {:?}", err);
}
});
}
}
# }
# fn main() {}
```

0 comments on commit 13b9b66

Please sign in to comment.