pub struct SiteMapBuilder { /* private fields */ }Expand description
Builder for constructing a SiteMap incrementally.
Implementations§
Source§impl SiteMapBuilder
impl SiteMapBuilder
Sourcepub fn set_has_sitemap(&mut self, has: bool)
pub fn set_has_sitemap(&mut self, has: bool)
Set whether the site had a sitemap.xml.
Sourcepub fn add_node(
&mut self,
url: &str,
page_type: PageType,
features: [f32; 128],
confidence: u8,
) -> u32
pub fn add_node( &mut self, url: &str, page_type: PageType, features: [f32; 128], confidence: u8, ) -> u32
Add a node and return its index.
Sourcepub fn add_edge(
&mut self,
from: u32,
to: u32,
edge_type: EdgeType,
weight: u8,
flags: EdgeFlags,
)
pub fn add_edge( &mut self, from: u32, to: u32, edge_type: EdgeType, weight: u8, flags: EdgeFlags, )
Add an edge between two nodes.
Sourcepub fn add_action(
&mut self,
node: u32,
opcode: OpCode,
target_node: i32,
cost_hint: u8,
risk: u8,
)
pub fn add_action( &mut self, node: u32, opcode: OpCode, target_node: i32, cost_hint: u8, risk: u8, )
Add an action available on a node.
Sourcepub fn add_action_http(
&mut self,
node: u32,
opcode: OpCode,
target_node: i32,
cost_hint: u8,
risk: u8,
)
pub fn add_action_http( &mut self, node: u32, opcode: OpCode, target_node: i32, cost_hint: u8, risk: u8, )
Add an HTTP-executable action available on a node.
HTTP-executable actions can be executed via HTTP POST/GET without a browser.
Sourcepub fn set_rendered(&mut self, node: u32, features: [f32; 128])
pub fn set_rendered(&mut self, node: u32, features: [f32; 128])
Mark a node as rendered with updated features and flags.
Sourcepub fn get_feature(&self, node: u32, dimension: usize) -> f32
pub fn get_feature(&self, node: u32, dimension: usize) -> f32
Read a single feature dimension for an existing node.
Sourcepub fn update_feature(&mut self, node: u32, dimension: usize, value: f32)
pub fn update_feature(&mut self, node: u32, dimension: usize, value: f32)
Update a single feature dimension for an existing node.
Used to patch feature vectors after initial encoding — for example, to inject HTTP action counts discovered in Layer 2.5.
Sourcepub fn merge_flags(&mut self, node: u32, flags: NodeFlags)
pub fn merge_flags(&mut self, node: u32, flags: NodeFlags)
Merge additional flag bits into a node’s flags.
Used to set computed flags like HAS_PRICE, HAS_MEDIA, HAS_FORM
after feature encoding.
Auto Trait Implementations§
impl Freeze for SiteMapBuilder
impl RefUnwindSafe for SiteMapBuilder
impl Send for SiteMapBuilder
impl Sync for SiteMapBuilder
impl Unpin for SiteMapBuilder
impl UnsafeUnpin for SiteMapBuilder
impl UnwindSafe for SiteMapBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more