@@ -96,15 +96,15 @@ fn HttpRequestInternal::on_complete(Self, FuncRef[() -> Unit]) -> Unit
9696fn HttpRequestInternal::on_headers(Self, FuncRef[(@native.CStr) -> Unit]) -> Unit
9797
9898pub(all) struct HttpResponse {
99- mut status_code : &StatusCoder
99+ mut status_code : StatusCode
100100 headers : Map[StringView, StringView]
101101 cookies : Map[String, CookieItem]
102102 mut raw_body : Bytes
103103}
104104fn HttpResponse::body(Self, &Responder) -> Self
105105fn HttpResponse::delete_cookie(Self, String) -> Unit
106- fn HttpResponse::json(Self, Json ) -> Self
107- fn HttpResponse::new(&StatusCoder , headers? : Map[StringView, StringView], cookies? : Map[String, CookieItem], raw_body? : Bytes) -> Self
106+ fn HttpResponse::json(Self, &ToJson ) -> Self
107+ fn HttpResponse::new(StatusCode , headers? : Map[StringView, StringView], cookies? : Map[String, CookieItem], raw_body? : Bytes) -> Self
108108fn HttpResponse::set_cookie(Self, String, String, max_age? : Int, path? : String, domain? : String, secure? : Bool, http_only? : Bool, same_site? : SameSiteOption) -> Unit
109109fn HttpResponse::to_responder(Self) -> &Responder
110110impl Responder for HttpResponse
@@ -239,10 +239,12 @@ pub(all) enum StatusCode {
239239 LoopDetected
240240 NotExtended
241241 NetworkAuthenticationRequired
242+ Custom(Int)
242243}
244+ fn StatusCode::from_int(Int) -> Self
245+ fn StatusCode::to_int(Self) -> Int
243246impl Show for StatusCode
244247impl ToJson for StatusCode
245- impl StatusCoder for StatusCode
246248
247249pub enum WebSocketAggregatedMessage {
248250 Text(String)
@@ -304,8 +306,3 @@ pub(open) trait ServeStaticProvider {
304306 get_fallthrough(Self) -> Bool
305307}
306308
307- pub trait StatusCoder {
308- to_int(Self) -> Int
309- }
310- impl StatusCoder for Int
311-
0 commit comments