pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/crates-dev/http-type/commit/8f1c430819d3bbc31d4607ce6d84aaba946554fe

07.css" /> feat: v15.0.0 · crates-dev/http-type@8f1c430 · GitHub
Skip to content

Commit 8f1c430

Browse files
committed
feat: v15.0.0
1 parent c734c2d commit 8f1c430

File tree

4 files changed

+1
-334
lines changed

4 files changed

+1
-334
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "http-type"
3-
version = "14.3.4"
3+
version = "15.0.0"
44
readme = "README.md"
55
edition = "2024"
66
authors = ["root@ltpp.vip"]

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ use {
5555
core::hash::BuildHasherDefault,
5656
lombok_macros::*,
5757
serde::{Deserialize, Serialize, de::DeserializeOwned},
58-
serde_json::{Map, Value},
5958
tokio::{
6059
io::{AsyncBufReadExt, AsyncReadExt, AsyncWriteExt, BufReader},
6160
net::TcpStream,

src/request/impl.rs

Lines changed: 0 additions & 166 deletions
Original file line numberDiff line numberDiff line change
@@ -1823,170 +1823,4 @@ impl Request {
18231823
pub fn is_disable_keep_alive(&self) -> bool {
18241824
!self.is_enable_keep_alive()
18251825
}
1826-
1827-
//github.com/ Serializes the request to a JSON byte vector.
1828-
//github.com/
1829-
//github.com/ This method attempts to serialize the entire request structure into a JSON
1830-
//github.com/ formatted byte vector representation.
1831-
//github.com/
1832-
//github.com/ # Returns
1833-
//github.com/
1834-
//github.com/ - `Result<Vec<u8>, serde_json::Error>` - The serialized JSON bytes on success,
1835-
//github.com/ or a serialization error on failure.
1836-
pub fn try_json_vec(&self) -> Result<Vec<u8>, serde_json::Error> {
1837-
serde_json::to_vec(self)
1838-
}
1839-
1840-
//github.com/ Serializes the request to a JSON byte vector.
1841-
//github.com/
1842-
//github.com/ This method serializes the entire request structure into a JSON formatted
1843-
//github.com/ byte vector representation.
1844-
//github.com/
1845-
//github.com/ # Returns
1846-
//github.com/
1847-
//github.com/ - `Vec<u8>` - The serialized JSON bytes.
1848-
//github.com/
1849-
//github.com/ # Panics
1850-
//github.com/
1851-
//github.com/ This function will panic if the serialization fails.
1852-
pub fn json_vec(&self) -> Vec<u8> {
1853-
self.try_json_vec().unwrap()
1854-
}
1855-
1856-
//github.com/ Serializes the request to a JSON byte vector with filtered fields.
1857-
//github.com/
1858-
//github.com/ This method attempts to serialize the request structure into a JSON formatted
1859-
//github.com/ byte vector representation, keeping only the fields that satisfy the predicate.
1860-
//github.com/
1861-
//github.com/ # Arguments
1862-
//github.com/
1863-
//github.com/ - `F: FnMut(&(&String, &mut Value)) -> bool` - A function that takes a reference to a map entry (&(&String, &mut Value)),
1864-
//github.com/ returns `true` to keep the field, `false` to remove it.
1865-
//github.com/
1866-
//github.com/ # Returns
1867-
//github.com/
1868-
//github.com/ - `Result<Vec<u8>, serde_json::Error>` - The serialized JSON bytes on success,
1869-
//github.com/ or a serialization error on failure.
1870-
pub fn try_json_vec_filter<F>(&self, predicate: F) -> Result<Vec<u8>, serde_json::Error>
1871-
where
1872-
F: FnMut(&(&String, &mut Value)) -> bool,
1873-
{
1874-
let mut value: Value = serde_json::to_value(self)?;
1875-
if let Some(map) = value.as_object_mut() {
1876-
let filtered: Map<String, Value> = map
1877-
.iter_mut()
1878-
.filter(predicate)
1879-
.map(|(key, value)| (key.clone(), value.clone()))
1880-
.collect();
1881-
return serde_json::to_vec(&Value::Object(filtered));
1882-
}
1883-
serde_json::to_vec(&value)
1884-
}
1885-
1886-
//github.com/ Serializes the request to a JSON byte vector with filtered fields.
1887-
//github.com/
1888-
//github.com/ This method serializes the request structure into a JSON formatted byte vector
1889-
//github.com/ representation, keeping only the fields that satisfy the predicate.
1890-
//github.com/
1891-
//github.com/ # Arguments
1892-
//github.com/
1893-
//github.com/ - `F: FnMut(&(&String, &mut Value)) -> bool` - A function that takes a reference to a map entry (&(&String, &mut Value)),
1894-
//github.com/ returns `true` to keep the field, `false` to remove it.
1895-
//github.com/
1896-
//github.com/ # Returns
1897-
//github.com/
1898-
//github.com/ - `Vec<u8>` - The serialized JSON bytes.
1899-
//github.com/
1900-
//github.com/ # Panics
1901-
//github.com/
1902-
//github.com/ This function will panic if the serialization fails.
1903-
pub fn json_vec_filter<F>(&self, predicate: F) -> Vec<u8>
1904-
where
1905-
F: FnMut(&(&String, &mut Value)) -> bool,
1906-
{
1907-
self.try_json_vec_filter(predicate).unwrap()
1908-
}
1909-
1910-
//github.com/ Serializes the request to a JSON string.
1911-
//github.com/
1912-
//github.com/ This method attempts to serialize the entire request structure into a JSON
1913-
//github.com/ formatted string representation.
1914-
//github.com/
1915-
//github.com/ # Returns
1916-
//github.com/
1917-
//github.com/ - `Result<String, serde_json::Error>` - The serialized JSON string on success,
1918-
//github.com/ or a serialization error on failure.
1919-
pub fn try_json_string(&self) -> Result<String, serde_json::Error> {
1920-
serde_json::to_string(self)
1921-
}
1922-
1923-
//github.com/ Serializes the request to a JSON string.
1924-
//github.com/
1925-
//github.com/ This method serializes the entire request structure into a JSON formatted
1926-
//github.com/ string representation.
1927-
//github.com/
1928-
//github.com/ # Returns
1929-
//github.com/
1930-
//github.com/ - `String` - The serialized JSON string.
1931-
//github.com/
1932-
//github.com/ # Panics
1933-
//github.com/
1934-
//github.com/ This function will panic if the serialization fails.
1935-
pub fn json_string(&self) -> String {
1936-
self.try_json_string().unwrap()
1937-
}
1938-
1939-
//github.com/ Serializes the request to a JSON string with filtered fields.
1940-
//github.com/
1941-
//github.com/ This method attempts to serialize the request structure into a JSON formatted
1942-
//github.com/ string representation, keeping only the fields that satisfy the predicate.
1943-
//github.com/
1944-
//github.com/ # Arguments
1945-
//github.com/
1946-
//github.com/ - `F: FnMut(&(&String, &mut Value)) -> bool` - A function that takes a reference to a map entry (&(&String, &mut Value)),
1947-
//github.com/ returns `true` to keep the field, `false` to remove it.
1948-
//github.com/
1949-
//github.com/ # Returns
1950-
//github.com/
1951-
//github.com/ - `Result<String, serde_json::Error>` - The serialized JSON string on success,
1952-
//github.com/ or a serialization error on failure.
1953-
pub fn try_json_string_filter<F>(&self, predicate: F) -> Result<String, serde_json::Error>
1954-
where
1955-
F: FnMut(&(&String, &mut Value)) -> bool,
1956-
{
1957-
let mut value: Value = serde_json::to_value(self)?;
1958-
if let Some(map) = value.as_object_mut() {
1959-
let filtered: Map<String, Value> = map
1960-
.iter_mut()
1961-
.filter(predicate)
1962-
.map(|(key, value)| (key.clone(), value.clone()))
1963-
.collect();
1964-
return serde_json::to_string(&Value::Object(filtered));
1965-
}
1966-
serde_json::to_string(&value)
1967-
}
1968-
1969-
//github.com/ Serializes the request to a JSON string with filtered fields.
1970-
//github.com/
1971-
//github.com/ This method serializes the request structure into a JSON formatted string
1972-
//github.com/ representation, keeping only the fields that satisfy the predicate.
1973-
//github.com/
1974-
//github.com/ # Arguments
1975-
//github.com/
1976-
//github.com/ - `FnMut(&(&String, &mut Value)) -> bool` - A function that takes a reference to a map entry (&(&String, &mut Value)),
1977-
//github.com/ returns `true` to keep the field, `false` to remove it.
1978-
//github.com/
1979-
//github.com/ # Returns
1980-
//github.com/
1981-
//github.com/ - `String` - The serialized JSON string.
1982-
//github.com/
1983-
//github.com/ # Panics
1984-
//github.com/
1985-
//github.com/ This function will panic if the serialization fails.
1986-
pub fn json_string_filter<F>(&self, predicate: F) -> String
1987-
where
1988-
F: FnMut(&(&String, &mut Value)) -> bool,
1989-
{
1990-
self.try_json_string_filter(predicate).unwrap()
1991-
}
19921826
}

src/response/impl.rs

Lines changed: 0 additions & 166 deletions
Original file line numberDiff line numberDiff line change
@@ -584,170 +584,4 @@ impl Response {
584584
response_bytes.extend_from_slice(&body);
585585
response_bytes
586586
}
587-
588-
//github.com/ Serializes the response to a JSON byte vector.
589-
//github.com/
590-
//github.com/ This method attempts to serialize the entire response structure into a JSON
591-
//github.com/ formatted byte vector representation.
592-
//github.com/
593-
//github.com/ # Returns
594-
//github.com/
595-
//github.com/ - `Result<Vec<u8>, serde_json::Error>` - The serialized JSON bytes on success,
596-
//github.com/ or a serialization error on failure.
597-
pub fn try_json_vec(&self) -> Result<Vec<u8>, serde_json::Error> {
598-
serde_json::to_vec(self)
599-
}
600-
601-
//github.com/ Serializes the response to a JSON byte vector.
602-
//github.com/
603-
//github.com/ This method serializes the entire response structure into a JSON formatted
604-
//github.com/ byte vector representation.
605-
//github.com/
606-
//github.com/ # Returns
607-
//github.com/
608-
//github.com/ - `Vec<u8>` - The serialized JSON bytes.
609-
//github.com/
610-
//github.com/ # Panics
611-
//github.com/
612-
//github.com/ This function will panic if the serialization fails.
613-
pub fn json_vec(&self) -> Vec<u8> {
614-
self.try_json_vec().unwrap()
615-
}
616-
617-
//github.com/ Serializes the response to a JSON byte vector with filtered fields.
618-
//github.com/
619-
//github.com/ This method attempts to serialize the response structure into a JSON formatted
620-
//github.com/ byte vector representation, keeping only the fields that satisfy the predicate.
621-
//github.com/
622-
//github.com/ # Arguments
623-
//github.com/
624-
//github.com/ - `F: FnMut(&(&String, &mut Value)) -> bool` - A function that takes a reference to a map entry (&(&String, &mut Value)),
625-
//github.com/ returns `true` to keep the field, `false` to remove it.
626-
//github.com/
627-
//github.com/ # Returns
628-
//github.com/
629-
//github.com/ - `Result<Vec<u8>, serde_json::Error>` - The serialized JSON bytes on success,
630-
//github.com/ or a serialization error on failure.
631-
pub fn try_json_vec_filter<F>(&self, predicate: F) -> Result<Vec<u8>, serde_json::Error>
632-
where
633-
F: FnMut(&(&String, &mut Value)) -> bool,
634-
{
635-
let mut value: Value = serde_json::to_value(self)?;
636-
if let Some(map) = value.as_object_mut() {
637-
let filtered: Map<String, Value> = map
638-
.iter_mut()
639-
.filter(predicate)
640-
.map(|(key, value)| (key.clone(), value.clone()))
641-
.collect();
642-
return serde_json::to_vec(&Value::Object(filtered));
643-
}
644-
serde_json::to_vec(&value)
645-
}
646-
647-
//github.com/ Serializes the response to a JSON byte vector with filtered fields.
648-
//github.com/
649-
//github.com/ This method serializes the response structure into a JSON formatted byte vector
650-
//github.com/ representation, keeping only the fields that satisfy the predicate.
651-
//github.com/
652-
//github.com/ # Arguments
653-
//github.com/
654-
//github.com/ - `FnMut(&(&String, &mut Value)) -> bool` - A function that takes a reference to a map entry (&(&String, &mut Value)),
655-
//github.com/ returns `true` to keep the field, `false` to remove it.
656-
//github.com/
657-
//github.com/ # Returns
658-
//github.com/
659-
//github.com/ - `Vec<u8>` - The serialized JSON bytes.
660-
//github.com/
661-
//github.com/ # Panics
662-
//github.com/
663-
//github.com/ This function will panic if the serialization fails.
664-
pub fn json_vec_filter<F>(&self, predicate: F) -> Vec<u8>
665-
where
666-
F: FnMut(&(&String, &mut Value)) -> bool,
667-
{
668-
self.try_json_vec_filter(predicate).unwrap()
669-
}
670-
671-
//github.com/ Serializes the response to a JSON string.
672-
//github.com/
673-
//github.com/ This method attempts to serialize the entire response structure into a JSON
674-
//github.com/ formatted string representation.
675-
//github.com/
676-
//github.com/ # Returns
677-
//github.com/
678-
//github.com/ - `Result<String, serde_json::Error>` - The serialized JSON string on success,
679-
//github.com/ or a serialization error on failure.
680-
pub fn try_json_string(&self) -> Result<String, serde_json::Error> {
681-
serde_json::to_string(self)
682-
}
683-
684-
//github.com/ Serializes the response to a JSON string.
685-
//github.com/
686-
//github.com/ This method serializes the entire response structure into a JSON formatted
687-
//github.com/ string representation.
688-
//github.com/
689-
//github.com/ # Returns
690-
//github.com/
691-
//github.com/ - `String` - The serialized JSON string.
692-
//github.com/
693-
//github.com/ # Panics
694-
//github.com/
695-
//github.com/ This function will panic if the serialization fails.
696-
pub fn json_string(&self) -> String {
697-
self.try_json_string().unwrap()
698-
}
699-
700-
//github.com/ Serializes the response to a JSON string with filtered fields.
701-
//github.com/
702-
//github.com/ This method attempts to serialize the response structure into a JSON formatted
703-
//github.com/ string representation, keeping only the fields that satisfy the predicate.
704-
//github.com/
705-
//github.com/ # Arguments
706-
//github.com/
707-
//github.com/ - `FnMut(&(&String, &mut Value)) -> bool` - A function that takes a reference to a map entry (&(&String, &mut Value)),
708-
//github.com/ returns `true` to keep the field, `false` to remove it.
709-
//github.com/
710-
//github.com/ # Returns
711-
//github.com/
712-
//github.com/ - `Result<String, serde_json::Error>` - The serialized JSON string on success,
713-
//github.com/ or a serialization error on failure.
714-
pub fn try_json_string_filter<F>(&self, predicate: F) -> Result<String, serde_json::Error>
715-
where
716-
F: FnMut(&(&String, &mut Value)) -> bool,
717-
{
718-
let mut value: Value = serde_json::to_value(self)?;
719-
if let Some(map) = value.as_object_mut() {
720-
let filtered: Map<String, Value> = map
721-
.iter_mut()
722-
.filter(predicate)
723-
.map(|(key, value)| (key.clone(), value.clone()))
724-
.collect();
725-
return serde_json::to_string(&Value::Object(filtered));
726-
}
727-
serde_json::to_string(&value)
728-
}
729-
730-
//github.com/ Serializes the response to a JSON string with filtered fields.
731-
//github.com/
732-
//github.com/ This method serializes the response structure into a JSON formatted string
733-
//github.com/ representation, keeping only the fields that satisfy the predicate.
734-
//github.com/
735-
//github.com/ # Arguments
736-
//github.com/
737-
//github.com/ - `FnMut(&(&String, &mut Value)) -> bool` - A function that takes a reference to a map entry (&(&String, &mut Value)),
738-
//github.com/ returns `true` to keep the field, `false` to remove it.
739-
//github.com/
740-
//github.com/ # Returns
741-
//github.com/
742-
//github.com/ - `String` - The serialized JSON string.
743-
//github.com/
744-
//github.com/ # Panics
745-
//github.com/
746-
//github.com/ This function will panic if the serialization fails.
747-
pub fn json_string_filter<F>(&self, predicate: F) -> String
748-
where
749-
F: FnMut(&(&String, &mut Value)) -> bool,
750-
{
751-
self.try_json_string_filter(predicate).unwrap()
752-
}
753587
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy