mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Add ImmutableOrigin to allow for serializing origins
This commit is contained in:
parent
4f7e422054
commit
bfd7b950ad
21 changed files with 270 additions and 152 deletions
|
@ -7,19 +7,26 @@
|
|||
#![crate_name = "servo_url"]
|
||||
#![crate_type = "rlib"]
|
||||
|
||||
#[cfg(feature = "servo")] extern crate heapsize;
|
||||
#[cfg(feature = "servo")] #[macro_use] extern crate heapsize;
|
||||
#[cfg(feature = "servo")] #[macro_use] extern crate heapsize_derive;
|
||||
#[cfg(feature = "servo")] extern crate serde;
|
||||
#[cfg(feature = "servo")] #[macro_use] extern crate serde_derive;
|
||||
#[cfg(feature = "servo")] extern crate url_serde;
|
||||
|
||||
extern crate servo_rand;
|
||||
extern crate url;
|
||||
extern crate uuid;
|
||||
|
||||
pub mod origin;
|
||||
|
||||
pub use origin::{OpaqueOrigin, ImmutableOrigin, MutableOrigin};
|
||||
|
||||
use std::fmt;
|
||||
use std::net::IpAddr;
|
||||
use std::ops::{Range, RangeFrom, RangeTo, RangeFull, Index};
|
||||
use std::path::Path;
|
||||
use std::sync::Arc;
|
||||
use url::{Url, Origin, Position};
|
||||
use url::{Url, Position};
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
|
@ -68,8 +75,8 @@ impl ServoUrl {
|
|||
self.0.path()
|
||||
}
|
||||
|
||||
pub fn origin(&self) -> Origin {
|
||||
self.0.origin()
|
||||
pub fn origin(&self) -> ImmutableOrigin {
|
||||
ImmutableOrigin::new(self.0.origin())
|
||||
}
|
||||
|
||||
pub fn scheme(&self) -> &str {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue